If you're using MySQL, you should know that MySQL specifically reccomends AGAINST storing images in the database... and to instead store the image path in the database, and the image as a regular image in the filesystem.
Not that it can't be done, just know that its not really reccomended because of speed / space / #connections required to pull all the images out again.