diff --git a/src/dialogs/dialog-cell-format.c b/src/dialogs/dialog-cell-format.c
index af943eded..3f28feaa4 100644
--- a/src/dialogs/dialog-cell-format.c
+++ b/src/dialogs/dialog-cell-format.c
@@ -315,9 +315,14 @@ setup_pattern_button (GdkScreen *screen,
 		GtkButton *button = GTK_BUTTON (tmp);
 		if (do_image) {
 			char *res = g_strconcat ("/org/gnumeric/gnumeric/images/", name, ".xpm", NULL);
-			GtkWidget *image = from_icon
-				? gtk_image_new_from_icon_name (name, GTK_ICON_SIZE_DIALOG)
-				: gtk_image_new_from_resource (res);
+			GtkWidget *image;
+			if (from_icon)
+				image = gtk_image_new_from_icon_name (name, GTK_ICON_SIZE_DIALOG);
+			else {
+				GdkPixbuf *pixbuf = gdk_pixbuf_new_from_resource (res, NULL);
+				image = gtk_image_new_from_pixbuf (pixbuf);
+				g_object_unref (pixbuf);
+			}
 			g_free (res);
 			gtk_widget_show (image);
 			gtk_container_add (GTK_CONTAINER (tmp), image);
