Improve has_image method