         return cell
     }
     
-    // MARK: - UITableViewDelegate
+    func collectionView(collectionView: UICollectionView, layout: UICollectionViewLayout, sizeForItemAtIndexPath indexPath: NSIndexPath) -> CGSize {
+        let photo = self.photos[indexPath.row]
+        let height = CGRectGetHeight(self.frame) - BRNImagePreviewCell.sectionInset.top - BRNImagePreviewCell.sectionInset.bottom
+        let factor = height / photo.size.height
+        
+        return CGSizeMake(factor * photo.size.width, height)
+    }
+    
+    // MARK: - UICollectionViewDelegate
     
     func collectionView(collectionView: UICollectionView, didSelectItemAtIndexPath indexPath: NSIndexPath) {
         self.delegate?.imagePreviewCell?(self, didSelectImageAtIndex: indexPath.row)

        fatalError("init(coder:) has not been implemented")
    }

    // MARK: - UITableViewDataSource
    
    func numberOfSectionsInCollectionView(collectionView: UICollectionView) -> Int {
        return 1

    private class var animationDuration: Double {
        return 0.3
    }
    
    private let overlayView = UIView()
    private let tableView = UITableView()
    
    // MARK: Initialization
    
