                      if let date = takenDateForObs {
                         o.timeObserved = date
                      }
-
-                     for i in 0..<photoKeys.count {
+                     
+                     var position = 0
+                     for result in results {
+                        let photoKey = resultsToPhotoKeys[result]
+                        
                         let op = ExploreObservationPhotoRealm()
                         op.uuid = UUID().uuidString.lowercased()
                         op.timeCreated = Date()
                         op.timeUpdatedLocally = Date()
-                        op.position = i
-                        op.photoKey = photoKeys[i]
+                        op.position = position
+                        op.photoKey = photoKey
                         
                         o.observationPhotos.add(op)
                      }

         // user cancelled
         return
      }

      var photoKeys = [String]()
      
      var takenDateForObs: Date? = nil
      var takenLatitudeForObs: Double? = nil

                  }
               }
               
               if numLoaded == results.count {
                  // we've saved all the results to our photo library
                  // and can safely make our observation and move on
                  
