How to redirect images to external links properly?