         
         visiblePages.removeAll()
         
-        pagingScrollView.contentOffset = contentOffsetForPage(AtIndex: _currentPageIndex)
+        pagingScrollView.contentOffset = contentOffsetForPage(atIndex: _currentPageIndex)
         createPages()
     }
     

        return _photos.count / 3
    }
    
    private func frameForPage(AtIndex index: Int) -> CGRect {
        let bounds = pagingScrollView.bounds
        var pageFrame = bounds
        pageFrame.size.width -= 2 * PADDING

        
        let visibleBounds = pagingScrollView.bounds
        var index = Int(floor(visibleBounds.midX / visibleBounds.width))
        index = max(0, min(numberOfPhotos() - 1, index))
        
        let previousCurrentPageIndex = _currentPageIndex
        _currentPageIndex = index
