change attributes for img and anchors to become valid