Refactoring the ImageHelper class