--- uc_product.module	Fri Feb 27 16:41:32 2009
+++ uc_product.module.new	Fri Mar  6 14:39:05 2009
@@ -1605,8 +1605,22 @@ function uc_product_get_image_widget() {
 
   // Get the current image widget. (if any)
   if (!$got_widget) {
+    // Invoke hook to find widgets
     $image_widgets = uc_store_get_image_widgets();
-    $image_widget = $image_widgets[variable_get('uc_product_image_widget', NULL)];
+
+    // Find widget preference, if any
+    $widget_name = variable_get('uc_product_image_widget', NULL);
+
+    if ($widget_name != NULL) {
+      // Widget to use has been set in admin menu
+      $image_widget = $image_widgets[$widget_name];
+    }
+    else {
+      // Widget to use has not been chosen, so default to
+      // first element of array, if any
+      $image_widget = array_shift($image_widgets);
+    }
+
     $got_widget = TRUE;
   }
 
