refactoring ImageHelper