diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp
index 0ea206186c0b4cd2601c1a74056653b31127c4a6..1f8adbcb95ec7d3016461c9f90f3921c6110bd5b 100644
--- a/indra/newview/llappearancemgr.cpp
+++ b/indra/newview/llappearancemgr.cpp
@@ -3113,6 +3113,14 @@ void appearance_mgr_update_dirty_state()
 {
 	if (LLAppearanceMgr::instanceExists())
 	{
+		LLAppearanceMgr& app_mgr = LLAppearanceMgr::instance();
+		LLUUID image_id = app_mgr.getOutfitImage();
+		if(image_id.notNull())
+		{
+			LLPointer<LLInventoryCallback> cb = NULL;
+			link_inventory_object(app_mgr.getBaseOutfitUUID(), image_id, cb);
+		}
+
 		LLAppearanceMgr::getInstance()->updateIsDirty();
 		LLAppearanceMgr::getInstance()->setOutfitLocked(false);
 		gAgentWearables.notifyLoadingFinished();
@@ -3122,7 +3130,21 @@ void appearance_mgr_update_dirty_state()
 void update_base_outfit_after_ordering()
 {
 	LLAppearanceMgr& app_mgr = LLAppearanceMgr::instance();
-	
+	LLInventoryModel::cat_array_t sub_cat_array;
+	LLInventoryModel::item_array_t outfit_item_array;
+	gInventory.collectDescendents(app_mgr.getBaseOutfitUUID(),
+								sub_cat_array,
+								outfit_item_array,
+								LLInventoryModel::EXCLUDE_TRASH);
+	BOOST_FOREACH(LLViewerInventoryItem* outfit_item, outfit_item_array)
+	{
+		LLViewerInventoryItem* linked_item = outfit_item->getLinkedItem();
+		if (linked_item != NULL && linked_item->getActualType() == LLAssetType::AT_TEXTURE)
+		{
+			app_mgr.setOutfitImage(linked_item->getLinkedUUID());
+		}
+	}
+
 	LLPointer<LLInventoryCallback> dirty_state_updater =
 		new LLBoostFuncInventoryCallback(no_op_inventory_func, appearance_mgr_update_dirty_state);
 
diff --git a/indra/newview/llappearancemgr.h b/indra/newview/llappearancemgr.h
index 7dbb86d7f2b62bf13f04e4a12457a419f49272c7..2e570b918815e3dd574794f83e9af540489bec17 100644
--- a/indra/newview/llappearancemgr.h
+++ b/indra/newview/llappearancemgr.h
@@ -185,6 +185,9 @@ class LLAppearanceMgr: public LLSingleton<LLAppearanceMgr>
 	
 	void wearBaseOutfit();
 
+	void setOutfitImage(const LLUUID& image_id) {mCOFImageID = image_id;}
+	LLUUID getOutfitImage() {return mCOFImageID;}
+
 	// Overrides the base outfit with the content from COF
 	// @return false if there is no base outfit
 	bool updateBaseOutfit();
@@ -269,6 +272,8 @@ class LLAppearanceMgr: public LLSingleton<LLAppearanceMgr>
 	LLTimer mInFlightTimer;
 	static bool mActive;
 
+	LLUUID mCOFImageID;
+
 	std::auto_ptr<LLOutfitUnLockTimer> mUnlockOutfitTimer;
 
 	// Set of temp attachment UUIDs that should be removed