refactor_image_class