Prevent divide-by-zero in Counter::get_image