     override func viewDidLayoutSubviews() {
         super.viewDidLayoutSubviews()
         
-        if self.collectionView != nil {
-            self.collectionView.reloadData()
-        }
-
+        guard let collectionView = self.collectionView else {
+            return
+        }
+        
+        guard let flowLayout = collectionView.collectionViewLayout as? UICollectionViewFlowLayout else {
+            return
+        }
+        
+        flowLayout.invalidateLayout()
+        
     }
     
     // MARK: - UITableViewDataSource

        
        return imageView
    }

    func transitionDestinationImageViewFrame() -> CGRect {
        return CGRectZero
        
    }
    
    // MARK: UIViewControllerTransitioningDelegate

    func animationControllerForDismissedController(dismissed: UIViewController) -> UIViewControllerAnimatedTransitioning? {

        let animationController = PhotoSlider.ScaleupAnimationController(present: false)
        animationController.sourceTransition = dismissed as? ScaleupAnimationControllerTransitioning
        animationController.destinationTransition = self
        return animationController

    }
    
    func animationControllerForPresentedController(presented: UIViewController, presentingController presenting: UIViewController, sourceController source: UIViewController) -> UIViewControllerAnimatedTransitioning? {

    }
    
    func tableView(tableView: UITableView, heightForRowAtIndexPath indexPath: NSIndexPath) -> CGFloat {
        
        if indexPath.row == 0 {
            if UIDevice.currentDevice().orientation == UIDeviceOrientation.Portrait || UIDevice.currentDevice().orientation == UIDeviceOrientation.PortraitUpsideDown {
                return tableView.bounds.size.width
