Sorry, I can't give you the answer, but I can tell you why I can't give you the answer.
Storing images in a database is the wrong way to go about it. You use up way too much space and it is not as reliable as simply storing the path to the image. Your database will become slow and unmanagible in size if you are planning to store lots of images.
Upload the image to a folder and only store the image name...this works much better.