refactor image compound