diff --git a/image_fupload.module b/image_fupload.module
index 1f30bf2..8eab479 100644
--- a/image_fupload.module
+++ b/image_fupload.module
@@ -292,7 +292,24 @@ function file_validate($file, $validators = array()) {
 }
 
 /**
-* This helper function lists/read/write/delete special settings for the image previewlist 
+ * Converts the attributes string to an array.
+ *
+ * @param type $attributes
+ */
+function _fupload_get_attributes_array($attributes) {
+  $attr = array();
+  $matches = array();
+  if ($attributes) {
+    $n = preg_match_all('/(\w+)="([^"]*)"/', $attributes, $matches);
+    for($i=0; $i<$n; $i++) {
+      $attr[$matches[1][$i]] = $matches[2][$i];
+    }
+  }
+  return $attr;
+}
+
+/**
+* This helper function lists/read/write/delete special settings for the image previewlist
 * depending on the node type
 *
 * @param string $op
diff --git a/includes/images.previewlist.image.inc b/includes/images.previewlist.image.inc
index c637a40..fcced59 100644
--- a/includes/images.previewlist.image.inc
+++ b/includes/images.previewlist.image.inc
@@ -85,69 +85,69 @@ function fupload_list_images_image_validate($form, &$form_state) {
   // get nids of images and start batch process (validation)
   $type = node_get_types('type', str_replace("-", "_", check_plain(arg(2))));
   $image_nids = explode(';', $form_state['values']['image_nodes']);
-  
-  for ($i = 0; $i < count($image_nids); $i++) {  
+
+  for ($i = 0; $i < count($image_nids); $i++) {
     if (!empty($type->min_word_count) && isset($form_state['values']['body_' .$image_nids[$i]]) && count(explode(' ', $form_state['values']['body_' .$image_nids[$i]])) < $type->min_word_count) {
       form_set_error('body_' .$image_nids[$i], t('The body of the @img_number. image is too short. You need at least %words words.', array('%words' => $type->min_word_count, '@img_number' => $i + 1)));
-    }  
-  } 
+    }
+  }
 }
 
-function fupload_list_images_image_submit($form, &$form_state) {  
+function fupload_list_images_image_submit($form, &$form_state) {
   // get nids of images and start batch process (saving)
-  $image_nids = explode(';', $form_state['values']['image_nodes']); 
+  $image_nids = explode(';', $form_state['values']['image_nodes']);
   // name of image field
   $field_name = $form_state['values']['field_name'];
-  for ($i = 0; $i < count($image_nids); $i++) { 
-    // load full node object  
-    $node = node_load($image_nids[$i]);    
+  for ($i = 0; $i < count($image_nids); $i++) {
+    // load full node object
+    $node = node_load($image_nids[$i]);
     // new changes to node object
     $node->status = 1; // publish node
     $node->title = !empty($form_state['values']['title_' .$image_nids[$i]]) ? $form_state['values']['title_' .$image_nids[$i]] : $node->title; // work around [#227966]
     $node->body = $form_state['values']['body_' .$image_nids[$i]];
     if ($node->body == image_fupload_image_status($field_name, IMAGE_NOT_COMPLETED) || !isset($form_state['values']['body_' .$image_nids[$i]])) // nothing changed ==> empty body field
       $node->body = "";
-    $node->teaser = node_teaser($node->body, $form_state['values']['format_' .$image_nids[$i]]);    
-    $node->format = $form_state['values']['format_' .$image_nids[$i]];    
+    $node->teaser = node_teaser($node->body, $form_state['values']['format_' .$image_nids[$i]]);
+    $node->format = $form_state['values']['format_' .$image_nids[$i]];
     // save new node object
     node_save($node);
   }
   drupal_set_message(t('All images have been saved and published.'));
   drupal_set_message(t('Additonal images can be selected and uploaded now.'));
-  drupal_redirect_form($form);  
+  drupal_redirect_form($form);
 }
 
 function _fupload_imagepreview($node_image, $node_type) {
   $image_node_types = variable_get('image_node_types', array());
   $attributes = variable_get('fupload_previewlist_img_attributes', '');
   /** need to split image module and other cck related imagemodules to be able to provide the right
-     *     preview handling 
+     *     preview handling
      */
-  switch ($node_type) {    
+  switch ($node_type) {
 	case 'image':
       // image module
       if (!empty($image_node_types['image']['imagecache_preset'])) {
         // using ImageCache
-        $content = theme('imagecache', $image_node_types['image']['imagecache_preset'], $node_image->images['_original'], $node_image->title, $node_image->title, $attributes);
+        $content = theme('imagecache', $image_node_types['image']['imagecache_preset'], $node_image->images['_original'], $node_image->title, $node_image->title, _fupload_get_attributes_array($attributes));
       } else {
         // using a ready-to-use Image size of Image module
         $image = $node_image->images[$image_node_types['image']['image_selection']];
         $content = theme('fupload_imagepreview_image', $image, image_get_info($image), $node_image, $attributes);
       }
       break;
-    
+
     default:
       // imagefield cck module
       if (!empty($image_node_types[$node_type]['imagecache_preset'])) {
         // using ImageCache
         $field_name = $image_node_types[$node_type]['fieldname'];
         $image = $node_image->$field_name;
-        
-        $content = theme('imagecache', $image_node_types[$node_type]['imagecache_preset'], $image[0]['filepath'], $node_image->title, $node_image->title, $attributes);
+
+        $content = theme('imagecache', $image_node_types[$node_type]['imagecache_preset'], $image[0]['filepath'], $node_image->title, $node_image->title, _fupload_get_attributes_array($attributes));
       }
       break;
   }
-  
+
   return $content;
 }
 
diff --git a/includes/images.previewlist.imagefield.inc b/includes/images.previewlist.imagefield.inc
index 5f8b8a1..1feda68 100644
--- a/includes/images.previewlist.imagefield.inc
+++ b/includes/images.previewlist.imagefield.inc
@@ -69,11 +69,11 @@ function fupload_list_images_imagefield(&$form_state, $node_type) {
     );
     $form[$image->fid]['preview_image'] = array(
         '#prefix' => '<div class="image_fupload_preview">',
-        '#value' => theme('imagecache', $image_node_types[$node_type]['imagecache_preset'], $image->filepath, check_plain($image->filename), check_plain($image->filename), $field_image['widget']['fupload_previewlist_img_attributes']),
+        '#value' => theme('imagecache', $image_node_types[$node_type]['imagecache_preset'], $image->filepath, check_plain($image->filename), check_plain($image->filename), _fupload_get_attributes_array($field_image['widget']['fupload_previewlist_img_attributes'])),
         '#suffix' => '</div>',
-        '#weight' => -16,        
+        '#weight' => -16,
     );
-    
+
     // node title field
     if (in_array("title", $fields_preview_list['node'])) {
       $form[$image->fid]['node_title_' .$image->fid] = array(
