I have to clear my head and pull those files out again.
One program to check out is at:
http://www.watson-net.com/
in their cgi area. It shows how to do a few neat things.
Another program is at:
http://www.nihongo.org/snowhare/utilities/htmlthumbnail/
This program can be fed the original image, some parameters, and generate a very pretty thumbnail in a different directory -- you just need to feed it complete path data, otherwise it assumes relative and is unpredictable. IT's not a CGI program, but can be executed via telnet or from another script.
Ideal would be to browse the harddrive, see a preview of the image file, click "Ok" to upload it, then have it resized and made into a thumbnail, with the Ht/Width for both the original and thumbnail inserted into Links.
Another use would be if H/W exceed a parameter, or if overall file size exceeds a certain size, re-size it with higher compression, and re-present it to the user to OK -- just like LinkExchange.