I have gone through a similar project - the images had to be in the database as BLOB fields instead of on the web server as files. The only way to access the photos in the database is to create a server side program - a CGI, a Java Servlet, whatever you're comfortable with. I will say that ASP is possible, but is a collossal pain for this particular task.
The server side program will access the database, select the image, then send a Content-type: image/png header, then send the raw bytes that make up the image. You'll call your server side program like this:
program is the name of the server-side program. Key is a parameter name, and picid would be the value for the key - you'll use that in your program to select the correct picture. The elipsis represents the rest of the tag (alt attribute, for example).
Good luck.
Jay
www.jayeckles.com