I would make a simple database table which has one field (photoNum or some such) and then on your asp page do something like this:
Code:
<%
'Connect to SQL Server or Access
Response.write "<a href=""" & objRS("photoNum") & ".jpg""><img src=""" & objRS("photoNum") & ".jpg"" width=""50"" height=""50""></a>"
Response.write "<a href=""0.jpg"">First</a>"
Response.write "<a href=""" & objRS("photoNum") - 1 & ".jpg"">Prev</a>"
Response.write "<a href=""" & objRS("photoNum") + 1 & ".jpg"">Next</a>"
Response.write "<a href=""YOURMAX.jpg"">Last</a>"
%>
You obviously have to add some kind of validation to make sure objRS("photoNum") - 1 isn't negative, etc. Hope this helps.