Make set_image_count() efficient with large values.
#115
+29
−21
set_image_count() efficient with large values.
#115