Thanks to Stuart and Darren for the corrections to the create_thumbnail function. Another note on that function: imagecreatefromwbmp was incorrectly used. WBMPs are wireless bitmaps, not windows bitmaps (thanks to clambert at whitecrown), so the thumbnail routine as is will not be able to handle windows bitmaps. See the notes at http://us2.php.net/manual/en/function.imagecreatefromwbmp.php for tips on working with windows bitmaps.