Image refactoring