         
         if pin != nil {
             print("This worked!")
+        }
+        
+        executeSearch()
+        guard fetchedResultsController?.fetchedObjects?.count == 0 else {
+            let photos = fetchedResultsController?.fetchedObjects as? [Photo]
+            self.getVenueImages(true, photos){ (success) in
+                performUIUpdatesOnMain {
+                    guard success == true else {
+                        print("AN ERROR OCCURED LOADING PHOTOS FROM CORE DATA")
+                        return
+                    }
+                    print("LOADED PHOTOS FROM COREDATA")
+                    if self.contentImages.count > 0 {
+                        let firstController = self.getItemController(0)!
+                        let startingViewControllers = [firstController]
+                        self.setViewControllers(startingViewControllers, direction: UIPageViewControllerNavigationDirection.forward, animated: true, completion: nil)
+                    }
+                }
+            }
+            return
         }
         
         setVenueImages() { (success) in

//

import UIKit

class BopPageViewController: UIPageViewController, UIPageViewControllerDataSource, FoursquareRequestType {


    var contentImages: [UIImage] = [UIImage(named: "placeholder")!]
    var pin: Pin?
    
    // Create NSFetchedResultsController
    lazy var fetchedResultsController: NSFetchedResultsController<NSFetchRequestResult>? = {
        let fetchRequest = NSFetchRequest<NSFetchRequestResult>(entityName: "Photo")
        fetchRequest.sortDescriptors = [NSSortDescriptor(key: "id", ascending: true)]
        fetchRequest.predicate = NSPredicate(format: "pin == %@", self.pin!)
        let fetchedResultsController = NSFetchedResultsController(fetchRequest: fetchRequest, managedObjectContext: AppDelegate.stack.context, sectionNameKeyPath: nil, cacheName: nil)
        return fetchedResultsController
    }()
    
    // MARK: Outlets
    
    // MARK: Life Cycle
