diff --git a/imagefield.module b/imagefield.module
index 9904c4c..2cddfda 100644
--- a/imagefield.module
+++ b/imagefield.module
@@ -244,12 +244,18 @@ function imagefield_file_insert($node, &$file, $field) {
   if (function_exists('token_replace')) {
     global $user;
     $widget_image_path = token_replace($field['widget']['image_path'], 'user', $user);
+    $widget_file_name = $field['widget']['image_file_name'] ?
+        token_replace($field['widget']['image_file_name'], 'global') . '.' . array_pop(split('\.',$file['filename'])) :
+        $file['filename'];
   }
   else {
     $widget_image_path = $field['widget']['image_path'];
+    $widget_file_name = $field['widget']['image_file_name'] ?
+        $field['widget']['image_file_name'] . '.' . array_pop(split('\.',$file['filename'])) :
+        $file['filename'];
   }
 
-  $filepath = file_create_path($widget_image_path) .'/'. $file['filename'];
+  $filepath = file_create_path($widget_image_path) . '/' . $widget_file_name;
 
   if (imagefield_check_directory($widget_image_path) && $file = file_save_upload((object)$file, $filepath)) {
     $file = (array)$file;
@@ -447,8 +453,14 @@ function imagefield_widget_settings($op, $widget) {
         '#default_value' => $widget['image_path'] ? $widget['image_path'] : '',
         '#description' => t('Optional subdirectory within the "%dir" directory where images will be stored. Do not include trailing slash.', array('%dir' => variable_get('file_directory_path', 'files'))),
       );
+      $form['image_file_name'] = array(
+        '#type' => 'textfield',
+        '#title' => t('Image file name'),
+        '#default_value' => $widget['image_file_name'] ? $widget['image_file_name'] : '',
+        '#description' => t('Optionally specify <em>base</em> file name (w/o extension) the image(s) will be renamed to. Name collisions are automatically resolved by Druapl through addition of suffixes.'),
+      );
       if (function_exists('token_replace')) {
-        $form['image_path']['#description'] .= ' '. t('You can use the following tokens in the image path.');
+        $form['image_path']['#description'] .= ' '. t('You can use the following tokens in the image path and file name.');
         $form['image_path']['#suffix'] = theme('token_help', 'user');
       }
       $form['file_extensions'] = array(
@@ -481,7 +493,7 @@ function imagefield_widget_settings($op, $widget) {
       break;
 
     case 'save':
-      return array('max_resolution', 'max_filesize', 'max_number_images', 'image_path', 'file_extensions', 'custom_alt', 'custom_title');
+      return array('max_resolution', 'max_filesize', 'max_number_images', 'image_path', 'image_file_name', 'file_extensions', 'custom_alt', 'custom_title');
   }
 }
 
