Keep imageType and mimeType properties in sync.
Merge branch 'keep_imagetype_and_mimetype_in_sync' of https://github.com/owncloud/core into keep_imagetype_and_mimetype_in_sync

* 'keep_imagetype_and_mimetype_in_sync' of https://github.com/owncloud/core:
  Change name of mimeTypeToImageType to getImageTypeForMimeType. Change setResourceFromString to private. Add imageType public getter method for unit tests.
  Test imageType property in the same way as mimeType.
  Change to camelCase for new method name. Make call to new method static.
  Move dupe code in loadFromBase64 and loadFromData into separate function.
  Prevents image type and mime type from getting out of sync.
  Prevents image type and mime type from getting out of sync.