Sure it works, technically it's no problem.
But now hit your server over the head with a large number of concurrent users
(100+) and see what kind of performance you get.
It is much more efficient to store the images on disk and only store a reference to the file's location in the database.
If you store the images in the database, you are just creating tons of overhead.