 
 extension MediaType {
     
-    fileprivate var media_type_string: String? {
+    fileprivate var _mimeType: MIMEType? {
         switch self {
-        case .bmp: return "image/bmp"
-        case .gif: return "image/gif"
-        case .heic: return "image/heic"
-        case .heif: return "image/heif"
-        case .jpeg: return "image/jpeg"
-        case .jpeg2000: return "image/jp2"
-        case .png: return "image/png"
-        case .tiff: return "image/tiff"
+        case .bmp: return .bmp
+        case .gif: return .gif
+        case .heic: return .heic
+        case .heif: return .heif
+        case .jpeg: return .jpeg
+        case .jpeg2000: return .jpeg2000
+        case .png: return .png
+        case .tiff: return .tiff
+        case .webp: return .webp
         default: return nil
         }
     }

    }
    
    fileprivate func encode(using storageType: MediaType, resolution: Resolution, properties: Any) -> String? {
        guard let mediaType = storageType.media_type_string else { return nil }
        guard let properties = properties as? [ImageRep.PropertyKey : Any] else { return nil }
        guard let data = self.representation(using: storageType, properties: properties) else { return nil }
        return "data:\(mediaType);base64," + data.base64EncodedString()

    }
    
    fileprivate func encode(using storageType: MediaType, resolution: Resolution, properties: Any) -> String? {
        guard let mediaType = storageType._mimeType?.serialize() else { return nil }
        guard let properties = properties as? [ImageRep.PropertyKey : Any] else { return nil }
        guard let data = self.representation(using: storageType, properties: properties) else { return nil }
        return "data:\(mediaType);base64," + data.base64EncodedString()
