diff --git a/imagefield_zip.ahah.inc b/imagefield_zip.ahah.inc
index c2c9900..b7cdb9d 100644
--- a/imagefield_zip.ahah.inc
+++ b/imagefield_zip.ahah.inc
@@ -9,34 +9,8 @@
  * AHAH menu callback.
  */
 function imagefield_zip_js($type_name, $field_name) {
-  $result = FALSE;
-  $images = array();
-
-  // File validation array for file_save_upload()
-  //  Has a .zip file extension.
-  //  Is valid zip.
-  $validators = array(
-    'file_validate_extensions' => array('zip'),
-    'imagefield_zip_is_valid_zip' => array(),
-  );
-
-  if ($file = file_save_upload($field_name . '_zip', $validators)) {
-    // Extract all files.
-    $extracted = imagefield_zip_extract($file->filepath);
-    if (!empty($extracted)) {
-      // Only select valid image files
-      $images = array_filter($extracted, '_imagefield_zip_is_archived_image');
-    }
-    else {
-      watchdog('imagefield_zip', 'Unpacked archive appears to be empty.', array(), WATCHDOG_WARNING);
-    }
-
-    // Delete the zip file as we extracted and used everything we wanted from it.
-    imagefield_zip_delete_file($file);
-  }
-  else {
-    watchdog('imagefield_zip', 'Failed to save uploaded file', array(), WATCHDOG_ERROR);
-  }
+  // Get all images from the zip field.
+  $images = imagefield_zip_save_and_extract_upload($field_name . '_zip');
 
   // Generate HTML for the images that where uploaded
   $result = imagefield_zip_add_files_to_form($type_name, $field_name, $images);
@@ -230,34 +204,8 @@ function imagefield_zip_add_files_to_form($type_name, $field_name, $files) {
  * AHAH menu callback.
  */
 function imagefield_zip_multigroup_js($type_name, $group_name) {
-  $result = FALSE;
-  $images = array();
-
-  // File validation array for file_save_upload()
-  //  Has a .zip file extension.
-  //  Is valid zip.
-  $validators = array(
-    'file_validate_extensions' => array('zip'),
-    'imagefield_zip_is_valid_zip' => array(),
-  );
-
-  if ($file = file_save_upload($group_name . '_zip', $validators)) {
-    // Extract all files.
-    $extracted = imagefield_zip_extract($file->filepath);
-    if (!empty($extracted)) {
-      // Only select valid image files
-      $images = array_filter($extracted, '_imagefield_zip_is_archived_image');
-    }
-    else {
-      watchdog('imagefield_zip', 'Unpacked archive appears to be empty.', array(), WATCHDOG_WARNING);
-    }
-
-    // Delete the zip file as we extracted and used everything we wanted from it.
-    imagefield_zip_delete_file($file);
-  }
-  else {
-    watchdog('imagefield_zip', 'Failed to save uploaded file', array(), WATCHDOG_ERROR);
-  }
+  // Get all images from the zip field.
+  $images = imagefield_zip_save_and_extract_upload($group_name . '_zip');
 
   // Generate HTML for the images that where uploaded
   $result = imagefield_zip_add_files_to_multigroup_form($type_name, $group_name, $images);
diff --git a/imagefield_zip.module b/imagefield_zip.module
index 8d9f822..5debcc0 100644
--- a/imagefield_zip.module
+++ b/imagefield_zip.module
@@ -41,11 +41,14 @@ function imagefield_zip_form_alter(&$form, &$form_state, $form_id) {
       && ($type = content_types($form['#node']->type))
         ) {
     $form['#after_build'][] = '_imagefield_zip_form_after_build';
-
     $groups = imagefield_zip_get_groups($form);
 
+    $changed = FALSE;
     foreach (_imagefield_zip_fields($type) as $field) {
-      _imagefield_zip_form($form, $field['field_name'], $form['#node'], $groups);
+      $changed = _imagefield_zip_form($form, $field['field_name'], $form['#node'], $groups);
+    }
+    if ($changed) {
+      $form['#submit'][] = 'imagefield_zip_page_submit';
     }
   }
 }
@@ -168,6 +171,109 @@ function _imagefield_zip_cck_walker(&$array, &$cck_field, &$zip_field) {
 }
 
 /**
+ * Stores the image files from ZIP files to the appropriate imagefields.
+ *
+ * @param $field_name
+ *   Field containing the zip upload file input.
+ * @return array
+ *   array of image file objects.
+ */
+function imagefield_zip_save_and_extract_upload($field_name) {
+  // File validation array for file_save_upload()
+  //  Has a .zip file extension.
+  //  Is valid zip.
+  $validators = array(
+    'file_validate_extensions' => array('zip'),
+    'imagefield_zip_is_valid_zip' => array(),
+  );
+
+  $images = array();
+  if ($file = file_save_upload($field_name, $validators)) {
+    // Extract all files.
+    $extracted = imagefield_zip_extract($file->filepath);
+    if (!empty($extracted)) {
+      // Only select valid image files
+      $images = array_filter($extracted, '_imagefield_zip_is_archived_image');
+    }
+    else {
+      watchdog('imagefield_zip', 'Unpacked archive appears to be empty.', array(), WATCHDOG_WARNING);
+    }
+
+    // Delete the zip file as we extracted and used everything we wanted from it.
+    imagefield_zip_delete_file($file);
+  }
+  else {
+    watchdog('imagefield_zip', 'Failed to save uploaded file', array(), WATCHDOG_ERROR);
+  }
+  return $images;
+}
+
+/**
+ * Stores the image files from ZIP files to the appropriate imagefields.
+ *
+ * @see imagefield_zip_page()
+ */
+function imagefield_zip_page_submit($form, &$form_state) {
+  // Get info from the form.
+  $type = content_types($form['#node']->type);
+  $form_element_children = element_children($form);
+  module_load_include('inc', 'content', 'includes/content.node_form');
+  global $user;
+
+  // Select the correct fields from the form.
+  $out = array();
+  foreach (_imagefield_zip_fields($type) as $zip_field) {
+    // Get filefield destination.
+    $field = content_fields($zip_field['field_name'], $form['#node']->type);
+    $dest = filefield_widget_file_path($field);
+
+    foreach ($form_element_children as $field_name) {
+      // Skip if not a zip upload field.
+      if ($zip_field['field_name'] . '_zip' != $field_name || empty($form[$field_name][$zip_field['field_name'] . '_upload'])) {
+        continue;
+      }
+
+      // Get images from the zip file.
+      $images = imagefield_zip_save_and_extract_upload($field_name);
+      if (empty($images)) {
+        continue;
+      }
+
+      // Put the file in the new element.
+      foreach ($images as $image) {
+        if ($file = field_file_save_file($image->filepath, array(), $dest)) {
+          foreach ($form_state['values'] as $value_field_name => &$value_field_data) {
+            // Skip if not the correct field.
+            if ($zip_field['field_name'] != $value_field_name) {
+              continue;
+            }
+
+            // Find an empty delta and save
+            $delta = 0;
+            while (!empty($value_field_data[$delta]['fid'])) {
+              $delta++;
+            }
+
+            // Add info and save into $form_state['values'].
+            $file += array(
+              'data' => array('title' => FALSE, 'alt' => FALSE),
+              'list' => TRUE,
+              '_weight' => $delta,
+              'uid' => $user->uid,
+              '_remove' => 0,
+              'upload' => FALSE,
+            );
+            unset($file['destination']);
+            unset($file['source']);
+            $value_field_data[$delta] = $file;
+          }
+        }
+      }
+    }
+  }
+}
+
+/**
  * Implementation of hook_form().
  */
 function _imagefield_zip_form(&$form, &$field_name, &$node, &$groups) {
@@ -182,8 +288,7 @@ function _imagefield_zip_form(&$form, &$field_name, &$node, &$groups) {
       if (!empty($group['fields'][$field_name])) {
 
         // Code adapted from content_multigroup_add_more().
-        $group_multiple = $group['settings']['multigroup']['multiple'];
-        if ($group_multiple != 1) {
+        if (empty($group['settings']['multigroup']['multiple']) || (isset($group['settings']['multigroup']['multiple']) && $group['settings']['multigroup']['multiple'] != 1)) {
           continue;
         }
 
