 cdn.fallback.inc |    4 ++--
 cdn.test         |    2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/cdn.fallback.inc b/cdn.fallback.inc
index 55aec64..46f3de5 100644
--- a/cdn.fallback.inc
+++ b/cdn.fallback.inc
@@ -26,11 +26,11 @@ function cdn_html_alter_image_urls(&$html) {
   $pattern .= "([\"|'][^>]*)>"; // End of opening <a> tag.
   $pattern .= "((<img\s+|<img\s+[^>]*\s+)src\s*=\s*[\"|'])([^\"|^']*)([\"|'])"; // Wrapped <img> tag.
   $pattern .= ")#i";
-  _cdn_html_alter_file_url($html, $pattern, 0, 4, 5, 1, 7, 11);
+  _cdn_html_alter_file_url($html, $pattern, 0, 4, 6, 1, 7, 11);
 
   // Image file URLs in <img> tags.
   $pattern = "#((<img\s+|<img\s+[^>]*\s+)src\s*=\s*[\"|'])($url_prefix_regex)([^\"|^'|^\?]*)()(\?[^\"|^']*)?([\"|'])#i";
-  _cdn_html_alter_file_url($html, $pattern, 0, 4, 5, 1, 7);
+  _cdn_html_alter_file_url($html, $pattern, 0, 4, 6, 1, 7);
 }
 
 /**
diff --git a/cdn.test b/cdn.test
index 0940a41..6719a55 100644
--- a/cdn.test
+++ b/cdn.test
@@ -485,7 +485,7 @@ class CDNImageTestCase extends CDNTestCase {
     $img_url = base_path() . 'foo/bar/showimage';
     $html = $template($img_url . '?formula=12345.png');
     cdn_html_alter_image_urls($html);
-    $this->assertIdentical($template($cdn . $img_url), $html, 'Image HTML correctly altered (query string stripped).');
+    $this->assertIdentical($template($cdn . $img_url . '?formula=12345.png'), $html, 'Image HTML correctly altered (query string stripped).');
 
     // Image altering type 2: "linked image", i.e. "<a><img /></a>"..
     $template = function($a_url, $img_url) {
