     
     var imageTableKey: SVGContext.ImageTableKey { get }
     
-    func encode(using storageType: ImageRep.MediaType, properties: [ImageRep.PropertyKey : Any]) -> String?
-}
-
-extension ImageRep.MediaType {
+    func encode(using storageType: MediaType, properties: [ImageRep.PropertyKey : Any]) -> String?
+}
+
+extension MediaType {
     
     fileprivate var media_type_string: String? {
         switch self {


extension SVGContext {
    
    private func _draw(image: SVGImageProtocol, transform: SDTransform, using storageType: ImageRep.MediaType, properties: [ImageRep.PropertyKey : Any]) {
        
        guard !self.transform.determinant.almostZero() else { return }
        

        return self.originalData.map { SVGContext.ImageTableKey($0) } ?? SVGContext.ImageTableKey(AnyImage(imageRep: self, fileBacked: true))
    }
    
    fileprivate func encode(using storageType: MediaType, properties: [ImageRep.PropertyKey : Any]) -> String? {
        guard let mediaType = self.mediaType?.media_type_string else { return nil }
        guard let data = self.originalData else { return AnyImage(imageRep: self, fileBacked: true).encode(using: storageType, properties: properties) }
        return "data:\(mediaType);base64," + data.base64EncodedString()
