Refactored image and tests