fix handling of image tag