fix double anchors around images

if the image is already inside an anchor dont wrap again