diff --git a/indra/llimage/llimage.cpp b/indra/llimage/llimage.cpp
index aa7c8c789aa4a300215d33753af1a8c500e76a5e..0fc5ca1ad6e79575c157b9f7e59db634423a0f21 100644
--- a/indra/llimage/llimage.cpp
+++ b/indra/llimage/llimage.cpp
@@ -168,8 +168,8 @@ U8* LLImageBase::allocateData(S32 size)
 		}
 		else
 		{
-		llerrs << "LLImageBase::allocateData: bad size: " << size << llendl;
-	}
+			llerrs << "LLImageBase::allocateData: bad size: " << size << llendl;
+		}
 	}
 	if (!mData || size != mDataSize)
 	{
@@ -267,10 +267,6 @@ LLImageRaw::LLImageRaw(U16 width, U16 height, S8 components)
 {
 	mMemType = LLMemType::MTYPE_IMAGERAW;
 	//llassert( S32(width) * S32(height) * S32(components) <= MAX_IMAGE_DATA_SIZE );
-	if(S32(width) * S32(height) * S32(components) > MAX_IMAGE_DATA_SIZE)
-	{
-		llwarns << "over size: width: " << (S32)width << " height: " << (S32)height << " components: " << (S32)components << llendl ;
-	}
 	allocateDataSize(width, height, components);
 	++sRawImageCount;
 }
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index 5b70e4bcb06b098ee2fa678f0847de0b9764cad2..fe6bd8eef0aad6c628df63e0a36388ec00ff4588 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -6609,7 +6609,7 @@
       <key>Type</key>
       <string>S32</string>
       <key>Value</key>
-      <integer>35</integer>
+      <integer>12</integer>
     </map>
     <key>RenderAvatarVP</key>
     <map>
diff --git a/indra/newview/featuretable.txt b/indra/newview/featuretable.txt
index de4d787d658819ffbcf95a9af1ffe0288bef71af..e8591ca0867a4e3a6b93fc5bfb184496bf33e09f 100644
--- a/indra/newview/featuretable.txt
+++ b/indra/newview/featuretable.txt
@@ -26,7 +26,7 @@ list all
 RenderAnisotropic			1	0
 RenderAvatarCloth			1	1
 RenderAvatarLODFactor		1	1.0
-RenderAvatarMaxVisible      1   35
+RenderAvatarMaxVisible      1   12
 RenderAvatarVP				1	1
 RenderCubeMap				1	1
 RenderDelayVBUpdate			1	0
diff --git a/indra/newview/featuretable_linux.txt b/indra/newview/featuretable_linux.txt
index adda7cec4dd435392605cfd83d9fb635e013f4c3..779490c9f76adc898cd2e910ae0dc05037348b12 100644
--- a/indra/newview/featuretable_linux.txt
+++ b/indra/newview/featuretable_linux.txt
@@ -26,7 +26,7 @@ list all
 RenderAnisotropic			1	0
 RenderAvatarCloth			1	1
 RenderAvatarLODFactor		1	1.0
-RenderAvatarMaxVisible      1   35
+RenderAvatarMaxVisible      1   12
 RenderAvatarVP				1	1
 RenderCubeMap				1	1
 RenderDelayVBUpdate			1	0
diff --git a/indra/newview/featuretable_mac.txt b/indra/newview/featuretable_mac.txt
index 82886d7e2cb115579f6431709ffecc0dcbf48be9..47033efc47046fa3f107b4367bd19c83784fac16 100644
--- a/indra/newview/featuretable_mac.txt
+++ b/indra/newview/featuretable_mac.txt
@@ -26,7 +26,7 @@ list all
 RenderAnisotropic				1	0
 RenderAvatarCloth				0	0
 RenderAvatarLODFactor			1	1.0
-RenderAvatarMaxVisible          1   35
+RenderAvatarMaxVisible          1   12
 RenderAvatarVP					1	0
 RenderCubeMap					1	1
 RenderDelayVBUpdate				1	0
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index f4004d5664c7d83da641d203d4a3d4d52d8e3610..7be69ba04d014aef4af00944d7dac7b161a70caf 100644
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -412,7 +412,7 @@ static void settings_to_globals()
 	LLVolumeImplFlexible::sUpdateFactor = gSavedSettings.getF32("RenderFlexTimeFactor");
 	LLVOTree::sTreeFactor				= gSavedSettings.getF32("RenderTreeLODFactor");
 	LLVOAvatar::sLODFactor				= gSavedSettings.getF32("RenderAvatarLODFactor");
-	LLVOAvatar::sMaxVisible				= gSavedSettings.getS32("RenderAvatarMaxVisible");
+	LLVOAvatar::sMaxVisible				= (U32)gSavedSettings.getS32("RenderAvatarMaxVisible");
 	LLVOAvatar::sVisibleInFirstPerson	= gSavedSettings.getBOOL("FirstPersonAvatarVisible");
 	// clamp auto-open time to some minimum usable value
 	LLFolderView::sAutoOpenTime			= llmax(0.25f, gSavedSettings.getF32("FolderAutoOpenDelay"));
diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp
index 52d227f82796d20296d8f732f72590e972291bf6..ceed90e21018087b8aa6f846fe1a4b3214436ef5 100644
--- a/indra/newview/lltexturefetch.cpp
+++ b/indra/newview/lltexturefetch.cpp
@@ -582,14 +582,26 @@ bool LLTextureFetchWorker::doWork(S32 param)
 {
 	LLMutexLock lock(&mWorkMutex);
 
-	if ((mFetcher->isQuitting() || mImagePriority < 1.0f || getFlags(LLWorkerClass::WCF_DELETE_REQUESTED)))
+	if ((mFetcher->isQuitting() || getFlags(LLWorkerClass::WCF_DELETE_REQUESTED)))
 	{
 		if (mState < DECODE_IMAGE)
 		{
 			return true; // abort
 		}
 	}
-	
+	if(mImagePriority < 1.0f)
+	{
+		if (mState == INIT || mState == LOAD_FROM_NETWORK || mState == LOAD_FROM_SIMULATOR)
+		{
+			return true; // abort
+		}
+	}
+	if(mState > CACHE_POST && !mCanUseNET && !mCanUseHTTP)
+	{
+		//nowhere to get data, abort.
+		return true ;
+	}
+
 	if (mFetcher->mDebugPause)
 	{
 		return false; // debug: don't do any work
@@ -777,7 +789,7 @@ bool LLTextureFetchWorker::doWork(S32 param)
 			}
 			// don't return, fall through to next state
 		}
-		else if (mSentRequest == UNSENT)
+		else if (mSentRequest == UNSENT && mCanUseNET)
 		{
 			// Add this to the network queue and sit here.
 			// LLTextureFetch::update() will send off a request which will change our state
@@ -830,6 +842,7 @@ bool LLTextureFetchWorker::doWork(S32 param)
 	
 	if (mState == SEND_HTTP_REQ)
 	{
+		if(mCanUseHTTP)
 		{
 			const S32 HTTP_QUEUE_MAX_SIZE = 8;
 			// *TODO: Integrate this with llviewerthrottle
@@ -895,6 +908,10 @@ bool LLTextureFetchWorker::doWork(S32 param)
 			}
 			// fall through
 		}
+		else //can not use http fetch.
+		{
+			return true ; //abort
+		}
 	}
 	
 	if (mState == WAIT_HTTP_REQ)
diff --git a/indra/newview/llviewerdisplay.cpp b/indra/newview/llviewerdisplay.cpp
index 3482ac508ed9940035f47734e1e0317d78477bb4..f7cde9a6cb3b8f22c58aeea75345468129901302 100644
--- a/indra/newview/llviewerdisplay.cpp
+++ b/indra/newview/llviewerdisplay.cpp
@@ -597,7 +597,7 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot)
 
 		LLPipeline::sFastAlpha = gSavedSettings.getBOOL("RenderFastAlpha");
 		LLPipeline::sUseFarClip = gSavedSettings.getBOOL("RenderUseFarClip");
-		LLVOAvatar::sMaxVisible = gSavedSettings.getS32("RenderAvatarMaxVisible");
+		LLVOAvatar::sMaxVisible = (U32)gSavedSettings.getS32("RenderAvatarMaxVisible");
 		LLPipeline::sDelayVBUpdate = gSavedSettings.getBOOL("RenderDelayVBUpdate");
 
 		S32 occlusion = LLPipeline::sUseOcclusion;
diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp
index eb0d4cb8ae8de120cabaaa99c598e61b032d4dc6..179002d2a869b36f584155ece87c7d89f6adbea0 100644
--- a/indra/newview/llvoavatar.cpp
+++ b/indra/newview/llvoavatar.cpp
@@ -595,7 +595,7 @@ LLVOAvatarSkeletonInfo* LLVOAvatar::sAvatarSkeletonInfo = NULL;
 LLVOAvatar::LLVOAvatarXmlInfo* LLVOAvatar::sAvatarXmlInfo = NULL;
 LLVOAvatarDictionary *LLVOAvatar::sAvatarDictionary = NULL;
 S32 LLVOAvatar::sFreezeCounter = 0;
-S32 LLVOAvatar::sMaxVisible = 50;
+U32 LLVOAvatar::sMaxVisible = 12;
 F32 LLVOAvatar::sRenderDistance = 256.f;
 S32	LLVOAvatar::sNumVisibleAvatars = 0;
 S32	LLVOAvatar::sNumLODChangesThisFrame = 0;
@@ -3173,23 +3173,23 @@ BOOL LLVOAvatar::updateCharacter(LLAgent &agent)
 		{ // muted avatars update at 16 hz
 			mUpdatePeriod = 16;
 		}
-		else if (visible && mVisibilityRank <= LLVOAvatar::sMaxVisible * 0.25f)
+		else if (visible && mVisibilityRank <= LLVOAvatar::sMaxVisible)
 		{ //first 25% of max visible avatars are not impostored
 			mUpdatePeriod = 1;
 		}
-		else if (visible && mVisibilityRank > LLVOAvatar::sMaxVisible * 0.75f)
-		{ //back 25% of max visible avatars are slow updating impostors
-			mUpdatePeriod = 8;
-		}
-		else if (visible && mVisibilityRank > (U32) LLVOAvatar::sMaxVisible)
+		else if (visible && mVisibilityRank > LLVOAvatar::sMaxVisible * 4)
 		{ //background avatars are REALLY slow updating impostors
 			mUpdatePeriod = 16;
 		}
+		else if (visible && mVisibilityRank > LLVOAvatar::sMaxVisible * 3)
+		{ //back 25% of max visible avatars are slow updating impostors
+			mUpdatePeriod = 8;
+		}
 		else if (visible && mImpostorPixelArea <= impostor_area)
 		{  // stuff in between gets an update period based on pixel area
 			mUpdatePeriod = llclamp((S32) sqrtf(impostor_area*4.f/mImpostorPixelArea), 2, 8);
 		}
-		else if (visible && mVisibilityRank > LLVOAvatar::sMaxVisible * 0.25f)
+		else if (visible && mVisibilityRank > LLVOAvatar::sMaxVisible)
 		{ // force nearby impostors in ultra crowded areas
 			mUpdatePeriod = 2;
 		}
diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h
index b30cce09f65d3930194ac3a4cbafa3ac67304d7e..4259bb8e7382018c5b79e7a1593f49d723aa24d2 100644
--- a/indra/newview/llvoavatar.h
+++ b/indra/newview/llvoavatar.h
@@ -223,8 +223,8 @@ class LLVOAvatar :
 public:
 	static S32		sRenderName;
 	static BOOL		sRenderGroupTitles;
-	static S32		sMaxVisible;
-	static F32		sRenderDistance; //distance at which avatars will render (affected by control "RenderAvatarMaxVisible")
+	static U32		sMaxVisible; //(affected by control "RenderAvatarMaxVisible")
+	static F32		sRenderDistance; //distance at which avatars will render.
 	static BOOL		sShowAnimationDebug; // show animation debug info
 	static BOOL		sUseImpostors; //use impostors for far away avatars
 	static BOOL		sShowFootPlane;	// show foot collision plane reported by server
diff --git a/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml b/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml
index 266fd6cb5e7e49393bbe871e9a19c9d2e4969acc..f4694180a121d36fc2eebbfba1f2a607f610da69 100644
--- a/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml
+++ b/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml
@@ -372,29 +372,17 @@
     decimal_digits="0"
     follows="left|top"
     height="16"
-    increment="2"
-    initial_value="35"
-    label="Max. avatar draw distance:"
+    increment="1"
+    initial_value="12"
+    label="Max. # of non-impostor avatars:"
     label_width="185"
     layout="topleft"
     left_delta="0"
     max_val="65"
     min_val="1"
-    name="MaxAvatarDrawDistance"
+    name="MaxNumberAvatarDrawn"
     top_pad="4"
     width="290" />
-    <text
-    type="string"
-    length="1"
-    follows="left|top"
-    height="12"
-    layout="topleft"
-    left_delta="291"
-    name="DrawDistanceMeterText3"
-    top_delta="0"
-    width="128">
-      m
-    </text>
 		<slider
 		control_name="RenderGlowResolutionPow"
 		decimal_digits="0"