Keep imagetype and mimetype in sync

This is the inverse of the PHP function image_type_to_mime_type. So I went with the same convention. mimeTypeToImageType ok?