Begin image upload cleanup

This portion moves the current functionality into its own controller, and cleans up the error handling a bit.