 class LightboxTransition: UIPercentDrivenInteractiveTransition {
 
   struct Timing {
-    static let transition: NSTimeInterval = 0.5
+    static let transition: NSTimeInterval = 0.4
   }
 
   lazy var panGestureRecognizer: UIPanGestureRecognizer = { [unowned self] in


  func transition(controller: LightboxController, show: Bool) {
    controller.view.backgroundColor = .blackColor()
    controller.view.alpha = show ? 1 : 0.95
    controller.collectionView.alpha = show ? 1 : 0
    lightboxController = controller

    if UIDevice.currentDevice().orientation != UIDeviceOrientation.LandscapeLeft
      && UIDevice.currentDevice().orientation != UIDeviceOrientation.LandscapeRight{
        if sourceViewCell != nil {
          self.sourceViewCell.lightboxView.imageView.center = CGPointMake(
            UIScreen.mainScreen().bounds.width/2, UIScreen.mainScreen().bounds.height/2)

          })
        } else {
          if self.lightboxController.view.alpha < 0.97 && !self.presentingViewController {
            UIView.animateWithDuration(0.4, animations: { () -> Void in
              self.lightboxController.view.alpha = 0
              }, completion: { _ in
                transitionContext.completeTransition(true)
