your best bet in my opinion would be to create the thumbnail when they upload the larger version. when they upload, the image is stored in a temporary file, like $_FILES['imagefield']['tmp_name'] which you could then use imagecreatefrom... on to get a new gd image, which you could then resize onto a new image. to get the binary contents of the image, you could either output the image to file, read the contents, insert into the db and delete the file, or use output buffering to capture the output of the image which would save the trouble of the file.
if you check out the [man]imagejpeg[/man] doc page search for a comment by rishcybernerd at email dot com and there is an example of it. see also [man]imagecopyresized[/man]