Index: src/main.c
===================================================================
--- src/main.c	(revision 1723)
+++ src/main.c	(working copy)
@@ -831,7 +831,9 @@
 	initialize_data ();
 	prepare_app ();
 
+	gdk_threads_enter ();
 	gtk_main ();
+	gdk_threads_leave ();
 
 	release_data ();
 	return 0;
Index: libgthumb/file-utils.c
===================================================================
--- libgthumb/file-utils.c	(revision 1723)
+++ libgthumb/file-utils.c	(working copy)
@@ -2864,6 +2864,12 @@
 	if (uri == NULL)
 		return NULL;
 
+	/* Handle UI requests first */
+	gdk_threads_enter ();
+	while (gtk_events_pending ())
+		gtk_main_iteration ();
+	gdk_threads_leave ();
+
 	/* gdk_pixbuf does not support VFS URIs directly, so
 	   make a local cache copy of remote files. */
 	local_file = obtain_local_file (uri);
@@ -2964,6 +2970,12 @@
 	if (mime_type == NULL)
 		return NULL;
 
+	/* Handle UI requests first */
+	gdk_threads_enter ();
+	while (gtk_events_pending ())
+		gtk_main_iteration ();
+	gdk_threads_leave ();
+
 	/* The video thumbnailer can handle VFS URIs directly */
 
 	if (mime_type_is_video (mime_type) && (factory != NULL)) {
