The question is different, but I believe that the accepted answer to this questionthis question might also work for you. tl;dr, you can generate a string of characters for each file and tack it onto the src in a given element. Because the string will be unique, the browser will interpret the file as something new even if it has the same name. Anybody looking at the file directly or saving it will just see it as its name without some random string or super-long index number. You should be able to do this when your page is generated (no need for extra database entries), as long as the string creation is algorithmic based on some data about the image. As long as the image stays the same, it'll be the same string.