Index: src/galeon-window.c
===================================================================
--- src/galeon-window.c	(revision 8918)
+++ src/galeon-window.c	(working copy)
@@ -115,9 +115,15 @@
 static gint GaleonWindowSignals[LAST_SIGNAL];
 
 /* These are the values of in gconf for these items */
+#ifdef HAVE_NEW_IMAGE_PERMISSION_NAME
+#define VIEW_IMAGES_ALWAYS	1
+#define VIEW_IMAGES_CURRENT	3
+#define VIEW_IMAGES_NEVER	2
+#else
 #define VIEW_IMAGES_ALWAYS	0
 #define VIEW_IMAGES_CURRENT	1
 #define VIEW_IMAGES_NEVER	2
+#endif
 #define ACCEPT_COOKIES_ALWAYS	0
 #define ACCEPT_COOKIES_CURRENT	1
 #define ACCEPT_COOKIES_NEVER	2
@@ -468,7 +474,6 @@
 
 static guint n_toggle_entries = G_N_ELEMENTS(toggle_entries);
 
-/* Keep this in order, see radio_group_set_from_value */
 static GtkRadioActionEntry image_radio_entries[] = {
 	{ "ViewImagesAlwaysAction", NULL, N_("_Always"), NULL,
 	  N_("View all images"), VIEW_IMAGES_ALWAYS },
@@ -480,7 +485,6 @@
 
 static guint n_image_radio_entries = G_N_ELEMENTS (image_radio_entries);
 
-/* Keep this in order, see radio_group_set_from_value */
 static GtkRadioActionEntry cookie_radio_entries[] = {
 	{ "WebCookiesAlwaysAction", NULL, N_("A_lways Allow"), NULL,
 	  N_("Always accept cookies"), ACCEPT_COOKIES_ALWAYS },
@@ -1160,13 +1164,22 @@
 radio_group_set_from_value (GaleonWindow *window, GtkRadioActionEntry *entries,
 			    int n_entries, GConfValue *value)
 {
-	GtkAction *action;
+	GtkAction *action = NULL;
 	int val = gconf_value_get_int(value);
-	g_return_if_fail (val < n_entries);
-	g_return_if_fail (entries[val].value == val);
+	int i;
 
-	action = gtk_action_group_get_action(window->priv->action_group, entries[val].name);
+	/* Figure out with GtkRadioActionEntry has our value. These
+	   lists are always very short, just iterate rather than use a
+	   reverse-lookup static table. */
+	for (i = 0; i < n_entries; i++) {
+	    if (entries[i].value == val) {
+		action = gtk_action_group_get_action(window->priv->action_group, entries[i].name);
+		break;
+	    }
+	}
 
+	g_return_if_fail (action != NULL);
+
 	if (! gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action)))
 	{
 		gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (action), TRUE);
