refactor image import()