image upload api endpoint

Allows images to be uploaded over the API and saves them to the local
filesystem. Some faff with dates and formats in order to work round
issues with mongoose and elasticsearch not going the right thing.

Fixes #214
attach extra properties to the image

e.g. source or notes
add image put endpoint to replace images over the API

PUT /:collection/:id/image/:image_id replaces the image with image_id.

Factors out the code common to the PUT and POST requests into functions
to reduce duplication.
API endpoint to delete individual images

DEL /:collection/:id/image/:image_id will remove that image and delete
the file on the server. This only works for images stored on the server
as remote images don't have IDs
delete all images API endpoint

DELETE /:collection/:id/image will remove all images associated with a
document and remove any image files on the server too