diff --git a/imagefield_zip.ahah.inc b/imagefield_zip.ahah.inc
index 11e996c..69a6a84 100644
--- a/imagefield_zip.ahah.inc
+++ b/imagefield_zip.ahah.inc
@@ -182,7 +182,7 @@ function imagefield_zip_add_files_to_form($type_name, $field_name, $files) {
   $form = form_builder(check_plain($_POST['form_id']), $form, $form_state);
 
   // Render the new output.
-  $field_form = array_shift(content_get_nested_elements($form, $field_name));
+  $field_form = imagefield_zip_array_find_element_by_key($field_name, $form);
 
   // We add a div around the new content to receive the ahah effect.
   foreach ($delta_used as $delta) {
