Refactored ImageUtils