         let maxOffset = width * 2
         if xOffset > maxOffset {
             let diff = xOffset - maxOffset
-            let newOffset = CGPoint(x: width + diff, y: 0)
+            let newX = width + diff
+            let newOffset = CGPoint(x: newX, y: 0)
             UIView.performWithoutAnimation {
                 setContentOffset(newOffset, animated: false)
             }

        let minOffset = width - bounds.width
        if xOffset < minOffset {
            let diff = minOffset - xOffset
            let newOffset = CGPoint(x: width + minOffset - diff, y: 0)
            UIView.performWithoutAnimation {
                setContentOffset(newOffset, animated: false)
            }

    }
    
    private func configureImage() {
        guard let image = image else {
            return
        }
        
        imageView.image = image
        leftImageView.image = image
        rightImageView.image = image
