replace a tag to link_to and img tag to image_tag