refactored image_processor.py