diff --git a/core/includes/theme.inc b/core/includes/theme.inc
index 0775bbf..d7f1b2b 100644
--- a/core/includes/theme.inc
+++ b/core/includes/theme.inc
@@ -1255,6 +1255,18 @@ function template_preprocess_image(&$variables) {
     if (isset($variables[$key])) {
       $variables['attributes'][$key] = $variables[$key];
     }
+    // At least 'alt' defaults to an empty string; allow to omit an attribute by
+    // overriding the variable to NULL.
+    if (array_key_exists($key, $variables)) {
+      // If there is a value for the variable, it overrides the attribute.
+      if (isset($variables[$key])) {
+        $attributes[$key] = $variables[$key];
+      }
+      // Otherwise, remove the attribute.
+      else {
+        unset($attributes[$key]);
+      }
+    }
   }
 }
 
