         if !self.enlargedPreviews {
             self.enlargedPreviews = true
             
+            self.collectionView.scrollToItemAtIndexPath(indexPath, atScrollPosition: .CenteredHorizontally, animated: true)
             self.setNeedsLayout()
             UIView.animateWithDuration(BRNImagePickerSheet.enlargementAnimationDuration*5, animations: { () -> Void in
                 self.tableView.beginUpdates()
                 self.tableView.endUpdates()
                 self.layoutIfNeeded()
-                //self.collectionView.scrollToItemAtIndexPath(indexPath, atScrollPosition: .CenteredHorizontally, animated: false)
                 scrolled = true
                 }, completion: { (finished) -> Void in
-                    let layout: BRNHorizontalImagePreviewFlowLayout = self.collectionView.collectionViewLayout as BRNHorizontalImagePreviewFlowLayout
-                    layout.showsSupplementaryViews = true
+                let layout: BRNHorizontalImagePreviewFlowLayout = self.collectionView.collectionViewLayout as BRNHorizontalImagePreviewFlowLayout
+                layout.showsSupplementaryViews = true
             })
         }
         

                group.setAssetsFilter(ALAssetsFilter.allPhotos())
                group.enumerateAssetsUsingBlock({ (asset: ALAsset!, index: Int, stop: UnsafeMutablePointer<ObjCBool>) -> Void in
                    if asset != nil {
                        // TODO: Rotate CGImage properly
                        
                        let representation: ALAssetRepresentation = asset.defaultRepresentation()
                        let photo = UIImage(CGImage: representation.fullResolutionImage().takeUnretainedValue())
                        self.photos.insert(photo, atIndex: 0)
                    }
                })


import UIKit
import AssetsLibrary

extension UIImageOrientation {
    init(_ value: ALAssetOrientation) {
        switch value {
        case .Up:
            self = .Up
        case .Down:
            self = .Down
        case .Left:
            self = .Left
        case .Right:
            self = .Right
        case .UpMirrored:
            self = .UpMirrored
        case .DownMirrored:
            self = DownMirrored
        case .LeftMirrored:
            self = .LeftMirrored
        case .RightMirrored:
            self = .RightMirrored
        }
    }
}

@objc protocol BRNImagePickerSheetDelegate {
    optional func imagePickerSheet(imagePickerSheet: BRNImagePickerSheet, clickedButtonAtIndex buttonIndex: Int)
