The do thumbnail at loading suggestion is great -- it may seem like a small task to generate the thumbnails dynamically but it always turns out that it is the straw that breaks the camels back when the site gets busy. The two ways I do it (they have different advantages and weaknesses) are: 1: as images are uploaded generate the thumbnails needed (usually in my case a few different sizes for different views). 2: Allow uploads to happen without creating thumbnails, but on first access to each type of thumbnail generate and cache it.
The first way works better when the addition of images to a site are controlled only by your app -- such as with a cgi form. The second works well when users can place images in a directory structure or in some other way to insert into the site without your app knowing about them.