Refactor image backends.