This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
You could write a servlet that retrieves the image data from the database and resizes it to your desired "thumbnail" size using an imaging library (JAI perhaps?). The servlet would set the appropriate content type headers and return the resized image data as the response. The servlet would be referenced from the html page using the img tag just like any other image.