fixed _is_image() check