Tweaking new hasImage function