Refactor image create in controller