     super.showHistory()
 
     if let image = visibleViewController.screenshotFromWindow(scale: SAHistoryNavigationViewController.kImageScale) {
-      screenshotImages += [image]
-    }
-
-    historyViewController.images = screenshotImages
+      screenshots += [ScreenShot(image: image, navigationItem: visibleViewController.navigationItem)]
+    }
+
+    historyViewController.images = screenshots.map() { $0.image }
     historyViewController.currentIndex = viewControllers.count - 1
     historyViewController.reload()
     historyViewController.view.alpha = 1.0

  }
}

public class SAHistoryNavigationViewController: UINavigationController {
  public var historyContentView = UIView()
  //FIXME: handle rotation

  private static let kImageScale: CGFloat = 1.0
  private var historyViewController = SAHistoryViewController()
  private var screenshotImages = [UIImage]()

  override public func viewDidLoad() {
    super.viewDidLoad()


extension SAHistoryNavigationViewController: UINavigationBarDelegate {
  public func navigationBar(navigationBar: UINavigationBar, didPopItem item: UINavigationItem) {
    screenshots = screenshots.filter { screenshot in
      return screenshot.navigationItem != item
    }
  }
}

