Make image upload a service

Improved testability