Refactor image-editor