Add unittests for image upload functionality in v1

This patch adds unittests for the code that handles uploading image data to the
image store in v1 of the api. upload_utils.py was created in order to make this
area of code more testable and move upload logic out of the images api
controller.

Fixes bug 1177999

Change-Id: I97f0fa052e65228abb50090af812c3ebec605744
Merge "Add unittests for image upload functionality in v1"