Index: shell/eog-window.c
===================================================================
RCS file: /cvs/gnome/eog/shell/eog-window.c,v
retrieving revision 1.193
diff -u -r1.193 eog-window.c
--- shell/eog-window.c	10 Jun 2006 20:26:43 -0000	1.193
+++ shell/eog-window.c	15 Jun 2006 07:23:14 -0000
@@ -3131,13 +3131,29 @@
 job_image_load_action (EogJob *job, gpointer data, GError **error)
 {
 	EogJobImageLoadData *job_data;
+	EogWindow *window;
+	EogImage *image;
 
 	job_data = (EogJobImageLoadData*) data;
+	window = EOG_JOB_DATA (job_data)->window;
+	image = job_data->image;
 
-	eog_image_load (EOG_IMAGE (job_data->image),
-			EOG_IMAGE_DATA_ALL,
-			job,
-			error);
+	/* It is quite possible that the image is in the job queue twice
+	 * (e.g. if the user scrolled forward then back through the
+	 *  thumbnails). In this case we skip the image load. Note that
+	 * the check when the job was queued isn't sufficient since the
+	 * other job may have been in the queue, but unexecuted. */
+	if (!eog_image_is_loaded (image)) {	  
+        	eog_image_load (EOG_IMAGE (job_data->image),
+				EOG_IMAGE_DATA_ALL,
+				job,
+				error);
+	} else {
+	  /* We still want to display the image with the finished
+	   * handler so we keep an extra ref to it to make sure it 
+	   * isn't released early. */
+	  g_object_ref (image);
+	}
 }
 
 static void
