Fix check for external images.