diff --git a/image_class.module b/image_class.module
index 51a9a9d..6ff19c3 100644
--- a/image_class.module
+++ b/image_class.module
@@ -55,7 +55,7 @@ function image_class_preprocess_field(&$variables) {
 
     foreach ($variables['items'] as $delta => &$item) {
       // Preserve any classes that has been set already.
-      if (is_array($item['content']['#item_attributes']['class'])) {
+      if (isset($item['content']['#item_attributes']['class']) && is_array($item['content']['#item_attributes']['class'])) {
         $class = array_merge($item['content']['#item_attributes']['class'], $class);
       }
 
