Refactoring image controller again