         updateUI()
     }
     
+    // MARK: - API
+    
+    /// This will center content offset horizontally and verticaly.
+    /// It's also called whenever `image` property is set.
+    open func centerContentOffset() {
+        let centerX = (stackView.frame.size.width - bounds.size.width) / 2.0
+        let centerY = (stackView.frame.size.height - bounds.size.height) / 2.0
+        let offset = CGPoint(x: centerX, y: centerY)
+        setContentOffset(offset, animated: false)
+    }
+    
     // MARK: - UIScrollViewDelegate
     
     /// View used for zooming is `imageView`, be sure to keep that logic.

        contentSize = size
    }
    
    private func configureZoomScales() {
        guard let image = image else {
            return
        }
        
        // get scales needed to perfectly fit the image
        let xScale = bounds.size.width / image.size.width
        let yScale = bounds.size.height / image.size.height

    
    public func scrollViewDidScroll(_ scrollView: UIScrollView) {
        if !scrollView.isDecelerating {
            fakeContentOffsetIfNeeded()
        }
    }
    
    public func scrollViewDidEndDecelerating(_ scrollView: UIScrollView) {
        fakeContentOffsetIfNeeded()
    }
    
    private func fakeContentOffsetIfNeeded() {
        if infiniteScroll {
            let xOffset = contentOffset.x
            let width = contentSize.width / 3
