         if let index = images.firstIndex(where: { (some) -> Bool in
             return some === selectedImage
         }) {
-            scrollView.contentOffset = CGPoint(x:CGFloat(index)*scrollView.bounds.size.width, y:0.0)
+            scrollView.contentOffset = contentViewOffset(index: index)
             currentPage = index
             if let delegate = mediaViewerDelegate {
                 hiddenImageView = delegate.imageViewForImage(images[index])

    override public func layoutSubviews() {
        super.layoutSubviews()

        scrollView.contentSize = CGSize(width: bounds.size.width * CGFloat(contentViews.count), height: bounds.size.height)

        for (index, image) in contentViews.enumerated() {
            image.frame = contentViewFrame(index: index)
        }

        scrollView.contentOffset = CGPoint(x:CGFloat(currentPage) * bounds.size.width, y:0.0)
    }

    // MARK: public

        scrollView.showsHorizontalScrollIndicator = false
        addSubview(scrollView)

        scrollView.setFullScreenConstraints(sideMargins: -Constants.leadingMargin)
    }

    private func updateViewWithImages(_ newImages: [MediaViewerImageModel], selectedImage: MediaViewerImageModel) {
        for (index, image) in newImages.enumerated() {
            let contentView = contentViewWithImageModel(image, index: index)
            contentViews.append(contentView)
        }

