--- image_attach.module	2011-03-03 18:50:31.910458489 +0100
+++ image_attach.module	2011-03-03 18:58:30.631734373 +0100
@@ -274,7 +274,7 @@ function image_attach_form_alter(&$form,
             '#type' => 'textfield',
             '#title' => t('Image title'),
             $value => '',
-            '#description' => t('The title the image will be shown with. Leave blank to use the filename.'),
+            '#description' => t('The title the image will be shown with. Leave blank to use the node title or the filename (if there is no node title).'),
           );
           // Provide an additional submit button, which adds an image and redirects
           // the user to the node edit form.
@@ -369,7 +369,8 @@ function image_attach_validate(&$form, &
       'file_validate_is_image' => array(),
     );
     if ($file = file_save_upload('image', $validators)) {
-      $image_title = $_POST['image_title'] ? $_POST['image_title'] : basename($file->filepath);
+      // try the image title field, then the node title, then the filename
+      $image_title = $_POST['image_title'] ? $_POST['image_title'] : ($_POST['title'] ? $_POST['title'] . ($num_images ? " - " . $num_images + 1 : "") : basename($file->filepath));
       // Initialize an image properly.
       $image = image_create_node_from($file->filepath, $image_title, '');
       if ($image && !form_get_errors()) {
