diff --git a/mailmime.inc b/mailmime.inc
index e04b27d..5a3a08b 100644
--- a/mailmime.inc
+++ b/mailmime.inc
@@ -437,7 +437,10 @@ class MailMIME extends Mail_mime {
     if ( ($url = drupal_strip_dangerous_protocols($matches[4]))
       && ($path = url_to_realpath($url))
       && is_file($path)
-      && $this->addHTMLImage($path)
+      // Add the image and include any query string ($matches[5]) in the 3rd
+      // "name" parameter. This enables compatibility with the token DoS fix
+      // added in Drupal 7.20.
+      && $this->addHTMLImage($path, NULL, $path . $matches[5])
     ) {
       // The parent method will replace this with the actual cid: string.
       $matches[4] = $path;
