I've never been a fan of storing BLOB data in a database for the reason that the database can become HUGE. I would say store them in a folder, and then keep a database to track them. Link them up via their names. That is my preferred way because it keeps the images external to the database, but still ties the database to the images.
The man who comes back through the Door in the Wall will never be quite the same as the man who went out.
How you want to do it is up to you, each had their ups and downs.
Doing it out of a MySQL database would be the most secure way because you must have the proper credentials to get it one way or another. This is probably not required for a simple image gallery. MySQL can would be able to do this fairly efficiently if the files were under a few kb each (and under a few million rows) on a capable server (shared servers are not capable). I prefer not to store files in a BLOB on the database since it is always slower than the filesystem (hence the name FILEsystem).
Working with them in folders is less secure, but faster and easier to work with, that is what I recommend for this type of things. If you want private images, store them below the webroot and have PHP display them for you.