You don't 🙂
Never store images in a database, it gives no advantage at all.
Instead, just upload the images using FTP, and store only the filename and location in the database, along with a description of the photo.
About the passwords, that is best done with a .htaccess file, that will allow you to password-protect a directory on your webserver and therefore protect all the images located in that directory.