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

            self = .data(data)
        }
        
        static func ==(lhs: ImageTableKey, rhs: ImageTableKey) -> Bool {
            switch (lhs, rhs) {
            case let (.image(lhs), .image(rhs)): return lhs.isStorageEqual(rhs)
            case let (.data(lhs), .data(rhs)): return lhs.isStorageEqual(rhs)
            default: return false
            }
        }
    }
}



extension Image: SVGImageProtocol {
    
    fileprivate var imageTableKey: SVGContext.ImageTableKey? {
        return SVGContext.ImageTableKey(AnyImage(self))
    }
    
    fileprivate func encode(using storageType: MediaType, 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()
    }
