modifies image extension to work correctly with images wrapped in a link