             }
         }
         didSet {
-            if !frame.size.equalTo(oldValue.size) {
-                configureZoomScales()
+            if !frame.size.equalTo(oldValue.size), let image = image {
+                updateZoomScales(with: image)
                 recoverFromResizing()
             }
         }

        resetImage()
        resetZoomScales()
        
        configureImage()
        configureZoomScales()
        
        centerContentOffset()
    }

        zoomScale = 1.0
    }
    
    private func updateImage(_ image: UIImage) {
        imageView.image = image
        if infiniteScroll {
            leftImageView.image = image
            rightImageView.image = image
        }
    }
    
    private func updateContentSize(with image: UIImage) {
        let size: CGSize
        if infiniteScroll {
            size = CGSize(width: image.size.width * 3, height: image.size.height)
