diff --git a/indra/llmessage/llcurl.cpp b/indra/llmessage/llcurl.cpp
index 4d92cfd32f7db1faacb04b4996735fbb4d33b3fd..095d8cd28b35f26aa69df6c8e4e7355541240246 100644
--- a/indra/llmessage/llcurl.cpp
+++ b/indra/llmessage/llcurl.cpp
@@ -1074,7 +1074,9 @@ void LLCurlRequest::get(const std::string& url, LLCurl::ResponderPtr responder)
 {
 	getByteRange(url, headers_t(), 0, -1, responder);
 }
-	
+
+// Note: (length==0) is interpreted as "the rest of the file", i.e. the whole file if (offset==0) or
+// the remainder of the file if not.
 bool LLCurlRequest::getByteRange(const std::string& url,
 								 const headers_t& headers,
 								 S32 offset, S32 length,
@@ -1092,6 +1094,11 @@ bool LLCurlRequest::getByteRange(const std::string& url,
 		std::string range = llformat("Range: bytes=%d-%d", offset,offset+length-1);
 		easy->slist_append(range.c_str());
 	}
+	else if (offset > 0)
+	{
+		std::string range = llformat("Range: bytes=%d-", offset);
+		easy->slist_append(range.c_str());
+	}
 	easy->setHeaders();
 	bool res = addEasy(easy);
 	return res;
diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp
index 2e1b409fa7cea2ff0842d15699a03c8654076884..6afecd7e13592410edfdcab370c40daeb5ea7f3e 100755
--- a/indra/newview/lltexturefetch.cpp
+++ b/indra/newview/lltexturefetch.cpp
@@ -775,6 +775,7 @@ U32 LLTextureFetchWorker::calcWorkPriority()
 }
 
 // mWorkMutex is locked
+// Merov : Change so to take into account size == 0 == max
 void LLTextureFetchWorker::setDesiredDiscard(S32 discard, S32 size)
 {
 	bool prioritize = false;
@@ -1214,6 +1215,11 @@ bool LLTextureFetchWorker::doWork(S32 param)
 				// Will call callbackHttpGet when curl request completes
 				std::vector<std::string> headers;
 				headers.push_back("Accept: image/x-j2c");
+				if (mRequestedSize == MAX_IMAGE_DATA_SIZE)
+				{
+					mRequestedSize = 0;
+					llinfos << "Merov debug : getByteRange, offset = " << offset << ", id = " << mID << llendl;
+				}
 				res = mFetcher->mCurlGetRequest->getByteRange(mUrl, headers, offset, mRequestedSize,
 															  new HTTPGetResponder(mFetcher, mID, LLTimer::getTotalTime(), mRequestedSize, offset, true));
 			}