             UIView.animateWithDuration(animationDuration,
                 animations: { () -> Void in
                     self.resizableImageView.frame = finalImageViewFrame
-                    self.doneButton.alpha = 1.0
-                    self.doneButton.frame = self.doneButtonShowFrame
+                    if self.displayCloseButton == true {
+                        self.closeButton.alpha = 1.0
+                        self.closeButton.frame = self.closeButtonShowFrame
+                    }
                     if self.displayDeleteButton == true {
                         self.deleteButton.alpha = 1.0
                         self.deleteButton.frame = self.deleteButtonShowFrame

        var thePage: SKZoomingScrollView = SKZoomingScrollView()
        for page in visiblePages {
            if (page.tag - pageIndexTagOffset) == index {
               thePage = page
               break
            }
        }
        return thePage

        
        translatedPoint = CGPoint(x: firstX, y: firstY + translatedPoint.y)
        scrollView.center = translatedPoint
        
        view.opaque = true
        
        // gesture end
