How to change the HTML output of link to image file?
Install the devel themer module. After enabling it you can point to whatever you want to change. It will tell you which theme method is actually called what options you have to implement your own one.