             closeButton.frame = CGRectMake(mainView.frame.size.width - 74, 50, 60, 30)
             closeButton.enabled = !orientation.isLandscape
             
-            NSTimer.scheduledTimerWithTimeInterval(0.1, target: self, selector: Selector("resetPager"), userInfo: nil, repeats: false)
+            scrollViewActive = false
+            pageViewController.dataSource = self
+            
+            defer{
+                resetPager()
+            }
+            //NSTimer.scheduledTimerWithTimeInterval(0.1, target: self, selector: Selector("resetPager"), userInfo: nil, repeats: false)
             
         }
         



//MARK: - ALHelperViewController
internal class ALHelperViewController: UIViewController, UIGestureRecognizerDelegate{
    var gallery: ALImageGalleryViewController!;
    var scrollView:UIScrollView!

    }
    
    override func viewDidLoad() {
        if(gallery.canBeDragged){
            let dragRecognizer = UIPanGestureRecognizer(target: self, action: "handleDragGesture:" )
            dragRecognizer.maximumNumberOfTouches = 1
            dragRecognizer.minimumNumberOfTouches = 1
            dragRecognizer.delegate = self
            self.view.addGestureRecognizer(dragRecognizer)
        }
        
    }
    
