It's because you're direct linking to the images. If you want to change the background color you'll need to put the images in a page with a background color and link to that instead.
With little knowledge of php you could save yourself the hassle of making all of those html documents and use one php file, use a variable named $picture and then when you link to the page to view your picture you'd do something like this <a href="pictureviewer.php&image=tag1">Tag 1</a>