             }
         }
         
+        guard let searchRegion = currentSearchRegion else {
+            return
+        }
+        
         let deltaLon = visibleRegion.span.longitudeDelta
         let lowestPrecision = QuadKeyPrecision(deltaLongitude: deltaLon)
+        
+        let searchDeltaLon = searchRegion.span.longitudeDelta
+        let lowestSearchPrecision = QuadKeyPrecision(deltaLongitude: searchDeltaLon)
+        
         let maxPrecision: QuadKeyPrecision = maxGroupingPrecision
+
         let currentPrecision = lowestPrecision + groupingPrecisionDelta
         let groupingPrecision = min(maxPrecision, currentPrecision)
         
-        guard let searchRegion = currentSearchRegion else {
-            return
-        }
-        
-        let searchDeltaLon = searchRegion.span.longitudeDelta
-        let lowestSearchPrecision = QuadKeyPrecision(deltaLongitude: searchDeltaLon)
         let currentSearchPrecision = lowestSearchPrecision + groupingPrecisionDelta
-
         
         guard groupingPrecision != currentGroupingPrecision else {
             updateShouldShowAllImages(currentPrecision: currentPrecision, currentSearchPrecision: currentSearchPrecision, maxPrecision: maxPrecision)

    private var showingAllImages = false
    private var greaterThanOneArticleGroupCount = 0
    
    func updateShouldShowAllImages(currentPrecision: QuadKeyPrecision, currentSearchPrecision: QuadKeyPrecision, maxPrecision: QuadKeyPrecision) {
        let shouldShowAllImages = currentPrecision > maxPrecision + 1 || (currentPrecision >= currentSearchPrecision + 2 && greaterThanOneArticleGroupCount == 0)
        
        if shouldShowAllImages != showingAllImages {
            for annotation in mapView.annotations {

            })
        }
        currentGroupingPrecision = groupingPrecision
        
        let showAllImages = shouldShowAllImages(currentPrecision: currentPrecision, currentSearchPrecision: currentSearchPrecision, maxPrecision: maxPrecision)
        if (!showAllImages) {
             self.updateShouldShowAllImages(currentPrecision: currentPrecision, currentSearchPrecision: currentSearchPrecision, maxPrecision: maxPrecision)
        }
        taskGroup.waitInBackground {
            if (showAllImages) {
                self.updateShouldShowAllImages(currentPrecision: currentPrecision, currentSearchPrecision: currentSearchPrecision, maxPrecision: maxPrecision)
            }
            self.groupingTaskGroup = nil
            if (self.needsRegroup) {
                self.needsRegroup = false
