How to keep cell position in UICollectionView when VC auto rotate?

I have a cell with image in Scroll view for zooming:

class ImagePageViewerCell: UICollectionViewCell, UIScrollViewDelegate {

  var scrollView: UIScrollView?
  var imageView: UIImageView = UIImageView(frame: UIScreen.main.bounds)
  var urlString: String?

  override func layoutSubviews() {
    print("Cell layoutSubviews", frame.origin)
    frame.origin.y = 0.0
    scrollView?.frame = .init(origin: .zero, size: UIScreen.main.bounds.size)
    scrollView?.layoutSubviews()
  }

  override init(frame: CGRect) {
    super.init(frame: UIScreen.main.bounds)
    scrollView = UIScrollView(frame: UIScreen.main.bounds)
    scrollView?.backgroundColor = UIColor.clear
    scrollView?.delegate = self
    scrollView?.minimumZoomScale = 1.0
    scrollView?.maximumZoomScale = 5.0
    scrollView?.contentInset = .zero
    addSubview(scrollView!)
  }

  func setImage(url: String?) {
    urlString = url
    imageView = UIImageView(frame: UIScreen.main.bounds)

    if urlString != nil {
      imageView.contentMode = .scaleAspectFit
      imageView.sd_setImage(with: URL(string: urlString!), completed: nil)
    } else {
      imageView.contentMode = .center
      imageView.image = #imageLiteral(resourceName: "noImage")
    }

    scrollView?.addSubview(imageView)
  }

  override func prepareForReuse() {
    scrollView!.subviews.forEach { $0.removeFromSuperview() }
    super.prepareForReuse()
  }

  func viewForZooming(in scrollView: UIScrollView) -> UIView? {
    return  urlString != nil ? imageView : nil
  }

  required init?(coder aDecoder: NSCoder) {
    fatalError("init(coder:) has not been implemented")
  }
}

I can't understand how I keep cell position when VC auto rotate. I try to use solution with coordinator(Keeping the contentOffset in a UICollectionView while rotating Interface Orientation) but this poor work with zooming. I try to use other solutions but I still have problems with collectionView position after rotation.