added images_count function