class.upload.php is a powerful and mature PHP class to manage uploaded files, and manipulate images in many ways. The script is available under a GPL license.
It was a stupid pathing error to the destination folder. I now have this working the way I want. And the security issue was caused by the fact that the path to the destination folder was wrong, so the getimagesize() command couldn't find the image to do its work!
Sorry for the bandwidth....