diff --git a/core/includes/theme.inc b/core/includes/theme.inc
index ddd9d70..232828f 100644
--- a/core/includes/theme.inc
+++ b/core/includes/theme.inc
@@ -1289,6 +1289,10 @@ function template_preprocess_image(&$variables) {
   $variables['attributes']['src'] = file_create_url($variables['uri']);
 
   foreach (array('width', 'height', 'alt', 'title') as $key) {
+    // If the property has already been defined in the attributes, do not override.
+    if (array_key_exists($key, $variables['attributes'])) {
+      continue;
+    }
     if (isset($variables[$key])) {
       $variables['attributes'][$key] = $variables[$key];
     }
diff --git a/core/modules/image/src/Tests/ImageThemeFunctionTest.php b/core/modules/image/src/Tests/ImageThemeFunctionTest.php
index 64bfdf1..bb19c8a 100644
--- a/core/modules/image/src/Tests/ImageThemeFunctionTest.php
+++ b/core/modules/image/src/Tests/ImageThemeFunctionTest.php
@@ -158,4 +158,50 @@ function testImageStyleTheme() {
     $this->assertEqual(count($elements), 1, 'theme_image_style() renders an image correctly with a NULL value for the alt option.');
   }
 
+  /**
+   * Tests that alt in image's attributes is shown correctly.
+   */
+  function testImageAltFunctionality() {
+    $image_with_alt_working = array(
+      '#theme' => 'image',
+      '#uri' => '/core/themes/bartik/logo.png',
+      '#alt' => 'Regular alt',
+      '#title' => 'Test title',
+      '#width' => '50%',
+      '#height' => '50%',
+      '#attributes' => array('class' => 'image-with-regular-alt', 'id' => 'my-img'),
+    );
+
+    $this->drupalSetContent(drupal_render($image_with_alt_working));
+    $elements = $this->xpath('//img[@class="image-with-regular-alt"]');
+    $this->assertEqual($this->getImageAlt($elements), 'Regular alt', 'Regular alt displays correctly');
+
+    $image_with_alt_attribute_not_working = array(
+      '#theme' => 'image',
+      '#uri' => '/core/themes/bartik/logo.png',
+      '#width' => '50%',
+      '#height' => '50%',
+      '#attributes' => array(
+        'class' => 'image-with-attribute-alt',
+        'id' => 'my-img',
+        'title' => 'New test title',
+        'alt' => 'Attribute alt',
+      ),
+    );
+
+    $this->drupalSetContent(drupal_render($image_with_alt_attribute_not_working));
+    $elements = $this->xpath('//img[@class="image-with-attribute-alt"]');
+    $this->assertEqual($this->getImageAlt($elements), 'Attribute alt', 'Attribute alt displays correctly');
+  }
+
+  /**
+   * Fetch the alt attribute of the first element
+   *
+   * @param SimpleXMLElement[] $xml_elements
+   * @return string
+   */
+  protected function getImageAlt($xml_elements) {
+    $element = current($xml_elements);
+    return (string) $element->attributes()->alt;
+  }
 }
