Refactor image change controller