"any database software for linux that could be installed in my webpage directory and used by html files"
it seems you are not an expert in creating dynamic web pages. There are several database engines that you can install: MySQL, PostgreSQL are the best known among a lot of others. But you don't install them in an web directory, usually. You have to configure them and you have to know what you are doing, hmm. When configured and running you can connect to them with programming or script languages.
If you have a web account with a running mysql connection you can probably find ready-to-go scripts for making a gallery or something like that here:
www.hotscripts.com