             let size = image.size
             var destinationSize = CGSize.zero
             
-            if image.size.height/image.size.width > view.frame.size.width/view.frame.size.height {
+            // Calculate size of image view so that it would fit in self.view
+            // This will make the transition more perfect than setting frame of UIImageView as self.view.bounds
+            if image.size.width/image.size.height > view.frame.size.width/view.frame.size.height {
                 destinationSize.width = view.frame.size.width
                 destinationSize.height = view.frame.size.width * (size.height / size.width)
             }

//MARK: Public data methods
extension DTPhotoViewerController {
    // Update data before calling theses methods
    public func insertPhotos(_ at: [Int], completion: ((Bool) -> Void)?) {
        let indexPaths = indexPathsForIndexes(indexes: at)
        
        collectionView.performBatchUpdates({ 
            self.collectionView.insertItems(at: indexPaths)
        }, completion: completion)
    }
    
    public func deletePhotos(_ at: [Int], completion: ((Bool) -> Void)?) {
        let indexPaths = indexPathsForIndexes(indexes: at)
        
        collectionView.performBatchUpdates({
            self.collectionView.deleteItems(at: indexPaths)
        }, completion: completion)
    }
    
    // Helper for indexpaths


//MARK: UICollectionViewDataSource
extension DTPhotoViewerController: UICollectionViewDataSource {
    //MARK: Public methods
    public var currentPhotoIndex: Int {
        return Int(scrollView.contentOffset.x / scrollView.frame.width)
    }
    
    public var currentPhotoZoomScale: CGFloat {
        let index = currentPhotoIndex
        let indexPath = IndexPath(item: index, section: 0)
        
        if let cell = collectionView.cellForItem(at: indexPath) as? DTPhotoCollectionViewCell {
            return cell.scrollView.zoomScale
        }
        
        return 1.0
    }
    
    public func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
        return dataSource?.numberOfItems(in: self) ?? 1
    }
