image loader refactoring