diff --git a/indra/newview/llinventorygallery.cpp b/indra/newview/llinventorygallery.cpp
index 083dfdc65eff97e4f21ce972acbb62ca76ac54c5..caf93b924c75c02d2820c53f0442d0837c1a13e7 100644
--- a/indra/newview/llinventorygallery.cpp
+++ b/indra/newview/llinventorygallery.cpp
@@ -158,6 +158,13 @@ LLInventoryGallery::~LLInventoryGallery()
         mUnusedItemPanels.pop_back();
         panelp->die();
     }
+    while (!mHiddenItems.empty())
+    {
+        LLPanel* panelp = mHiddenItems.back();
+        mHiddenItems.pop_back();
+        panelp->die();
+    }
+    
 
     if (gInventory.containsObserver(mCategoriesObserver))
     {
@@ -490,6 +497,7 @@ void LLInventoryGallery::removeFromGalleryLast(LLInventoryGalleryItem* item)
     if(item->isHidden())
     {
         mHiddenItems.pop_back();
+        // Note: item still exists!!!
         return;
     }
     int n_prev = mItemsAddedCount;
@@ -519,6 +527,7 @@ void LLInventoryGallery::removeFromGalleryMiddle(LLInventoryGalleryItem* item)
     if(item->isHidden())
     {
         mHiddenItems.erase(std::remove(mHiddenItems.begin(), mHiddenItems.end(), item), mHiddenItems.end());
+        // item still exists and needs to be deleted or used!!!
         return;
     }
     int n = mItemIndexMap[item];
@@ -859,6 +868,7 @@ void LLInventoryGallery::updateRemovedItem(LLUUID item_id)
         // kill removed item
         if (item != NULL)
         {
+            // Todo: instead of deleting, store somewhere to reuse later
             item->die();
         }
     }
@@ -1876,6 +1886,11 @@ BOOL LLInventoryGallery::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop,
     return handled;
 }
 
+bool LLInventoryGallery::areViewsInitialized()
+{
+    return mGalleryCreated && mItemBuildQuery.empty();
+}
+
 bool LLInventoryGallery::hasDescendents(const LLUUID& cat_id)
 {
     LLInventoryModel::cat_array_t* cats;
diff --git a/indra/newview/llinventorygallery.h b/indra/newview/llinventorygallery.h
index 66cffccebc15d5c1db00df6e2869c506ac35da20..d82d466aaf49a5a066420073b8a6ec0785363903 100644
--- a/indra/newview/llinventorygallery.h
+++ b/indra/newview/llinventorygallery.h
@@ -134,6 +134,7 @@ class LLInventoryGallery : public LLPanel, public LLEditMenuHandler
     void setSearchType(LLInventoryFilter::ESearchType type);
     LLInventoryFilter::ESearchType getSearchType() { return mSearchType; }
 
+    bool areViewsInitialized();
     bool hasDescendents(const LLUUID& cat_id);
     bool hasVisibleItems();
     void handleModifiedFilter();
diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp
index 3226cb51a4b21b4b3700d4aa52bca23fb2de2db6..107a00f35a4f0a23303683aa552c992c58d590cb 100644
--- a/indra/newview/llpanelmaininventory.cpp
+++ b/indra/newview/llpanelmaininventory.cpp
@@ -2386,7 +2386,6 @@ void LLPanelMainInventory::updateCombinationVisibility()
         bool is_gallery_empty = !mCombinationGalleryPanel->hasVisibleItems();
         bool show_inv_pane = mCombinationInventoryPanel->hasVisibleItems() || is_gallery_empty || mForceShowInvLayout;
         mCombinationGalleryLayoutPanel->setVisible(!is_gallery_empty);
-        mCombinationGalleryPanel->setVisible(true); // to make sure root updates are getting processed
         mCombinationListLayoutPanel->setVisible(show_inv_pane);
         mCombinationInventoryPanel->getRootFolder()->setForceArrange(!show_inv_pane);
         if(mCombinationInventoryPanel->hasVisibleItems())
@@ -2402,7 +2401,7 @@ void LLPanelMainInventory::updateCombinationVisibility()
 
         if (mReshapeInvLayout
             && show_inv_pane
-            && mCombinationGalleryPanel->hasVisibleItems()
+            && (mCombinationGalleryPanel->hasVisibleItems() || mCombinationGalleryPanel->areViewsInitialized())
             && mCombinationInventoryPanel->areViewsInitialized())
         {
             mReshapeInvLayout = false;