Tip:
put the code anywhere in the template, open the image details web page, see where that link its being showed. if you like it, leave it there, if you dont, move it to another place. Repeat the process untill you find the spot which you like
This tip is based on the information you've provided of what kind of template you are using and most important where is that you want to display the url.
So, if you dont know HTML, consider its your first step to learning it