         } else {
             thumbnailCols = 3
         }
+        height = size.height
+        width = size.width
     }
 
     private func getIndexAtPosition(#y: CGFloat) -> Int {

    override init() {
        width = 0; height = 0
        super.init()
        let size = self.collectionView?.bounds.size ?? UIScreen.mainScreen().bounds.size
        transitionToOrientation(UIView.viewOrientationForSize(size), atSize: size)
    }

    required init(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }

    private func transitionToOrientation(orientation: UIInterfaceOrientation, atSize size: CGSize) {
        setupForOrientation(orientation)
        height = size.height
        width = size.width
    }

    private func setupForOrientation(orientation: UIInterfaceOrientation) {
        if orientation.isLandscape {
            thumbnailCols = 5
        } else if UIScreen.mainScreen().traitCollection.userInterfaceIdiom == .Pad  {


    required init(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }

    deinit {
        NSNotificationCenter.defaultCenter().removeObserver(self, name: NotificationFirefoxAccountChanged, object: nil)
        NSNotificationCenter.defaultCenter().removeObserver(self, name: NotificationPrivateDataCleared, object: nil)
    }

    override func viewDidLoad() {
