--- upload_image.module.original	2006-07-06 03:03:12.000000000 +0200
+++ upload_image.module	2006-09-21 18:53:06.281250000 +0200
@@ -53,6 +53,26 @@
       );
     }
   }
+  else if ('image_settings_form' == $form_id) {
+    $sizes = _image_get_sizes();
+    $options = array();
+    foreach ($sizes as $size) {
+      $options[] = array($size['label'] => $size['label']);
+    }
+    $form['upload_image'] = array(
+      '#type' => 'fieldset',
+      '#title' => t('Upload image'),
+      '#collapsible' => TRUE,
+      '#weight' => -1,
+    );
+    $form['upload_image']['upload_image_derivative'] = array(
+      '#type' => 'select',
+      '#title' => t('Upload image size'),
+      '#default_value' => variable_get('upload_image_derivative', 'thumbnail'),
+      '#options' => $options,
+      '#description' => t('Select which image size should be used to display uploaded images.'),
+    );
+  }
 }
 
 /**
@@ -72,6 +92,7 @@
         $rows = array();
         $thumbnails = array();
 
+        $derivative = variable_get('upload_image_derivative', 'thumbnail'); 
         // Build list of attached files
         foreach ($node->files as $fid => $file) {
           if ($file->list) {
@@ -85,7 +106,7 @@
               $image = new StdClass();
               $image->nid = $images[$fid]->nid;
               image_load($image);
-              $thumbnails[] = l(module_invoke('image', 'display', $image, 'thumbnail'), "node/$image->nid", array(), NULL, NULL, FALSE, TRUE);
+              $thumbnails[] = l(module_invoke('image', 'display', $image, $derivative), "node/$image->nid", array(), NULL, NULL, FALSE, TRUE);
             }
           }
         }
