updated count_image_files