Keep imagetype and mimetype in sync

I intended this function to not just meet the needs in this class. I don't know where else this information could be used. It be a better fit in one of the utility classes. Image type to mime type is is simple, but as there are multiple image types for some mime types I wanted to make sure there was a way to be specific. See http://php.net/manual/en/function.image-type-to-mime-type.php for the list.

If there is no where else in OC that needs this then I'll remove the extra stuff and make it private. Which mime types wouldn't get used with this class?

I'll make setResourceFromString private anyway as it is only used by loadFromData and loadFromBase64.