Image generator refactoring