Replace <img> tag with href and img thumbnail