image service refactoring