You could create a thumbnail of the image on the fly to show to the viewer...would that help you out?
Check out the ImageCreateFromJPEG and related functions.
I have found that that way (creating thumbnails) works well with these functions, however, if you would like better quality in the image (that you have created on the fly) check on ImageMagick, it is better for actually re-sizing images and such.
-- Jason