Made mMaxImageWidth not static, otherwise other threads could modify its value and cause unexpected results.