refactoring + impl image.read handler