     }
     
     public func page(_ index: Int) -> ImageRep {
-        return ImageRep(base: base.page(index))
+        return cache.lck.synchronized {
+            if cache.pages[index] == nil {
+                cache.pages[index] = ImageRep(base: base.page(index))
+            }
+            return cache.pages[index]!
+        }
+    }
+    
+    fileprivate func image(option: MappedBufferOption) -> AnyImage {
+        return cache.lck.synchronized {
+            if cache.images[option] == nil {
+                cache.images[option] = base.image(option: option)
+            }
+            return cache.images[option]!
+        }
     }
 }
 


public struct ImageRep {
    
    fileprivate let base: ImageRepBase
    
    private init(base: ImageRepBase) {
        self.base = base
    }
}


    
    public func representation(using storageType: MediaType, properties: [PropertyKey : Any]) -> Data? {
        
        let image = base as? AnyImage ?? self.image(option: .fileBacked)
        guard image.width > 0 && image.height > 0 else { return nil }
        
        let Encoder: ImageRepEncoder.Type
