All you need to do is modify your tags. If you have an understanding of JavaScript, change the method to allow the filenames as parameters. When you add a link to an image, you, by default, get a border around the image. This border is the color of your links. This is very simple, just add it like you would a regular link.
Most people do steal html codse to disect and learn from.
This is, in most people's opinion, ok. I encourage my visitors to look at my source. What is not ok, is stealing content . If you want to see how I got a piece of text to display where I did, look at the code. If you want to copy the formatting and text, it is not ok.