refactor Malachite::GenericImage