I can’t help but mention here that it is really not a proper use of a shared web server’s resources to generate thumbnails. Hey, a few here and there are one thing, but when you are talking about the processing resources required to thumbnail “10,000’s” images, this should only be done a a VPS or Dedicated server, if at all.
While popular image gallery web applications will do this for you, common sense is called for. If you are not running a VPS or a dedicated machine, the upload/resize/thumbnail dance is really only appropriate for 5-10 images at at time, not for large batches of images.
Really, this processing is better done on your own computer, and then the generated thumbnails generated can be uploaded/rsynced to the web server for distribution.
I’ve done this for years, using batch image processing tools on my home machines (Google can help you find a free one you like, whatever your platform).
Think about it … the webserver is designed to serve web pages, and really isn’t a general purpose data processing platform. Sure, we give you shell access for the occasional scripting/processing stuff you need to make a site interactive, or accomplish an ancillary function related to serving your site, but that should not be considered an open invitation to use that access as a mass image processing engine.