improve image import, refactoring