Upload an image in a form programmatically
I would strongly suggest to use nodes and one of these modules
Comparison of image cropping and resizing modules

If you dont want nodes then you still should be able to use one of crop modules which works with image fields if you use entities, you can use Entity Construction Kit (ECK) module  to create custom entity types