--- image/contrib/image_gallery/image_gallery.module.orig	2008-02-02 08:48:31.000000000 +0200
+++ image/contrib/image_gallery/image_gallery.module	2008-02-02 09:15:35.000000000 +0200
@@ -52,7 +52,7 @@ function image_gallery_menu($may_cache) 
       'path' => 'admin/settings/image/image_gallery',
       'title' => t('Galleries'),
       'access' => user_access('administer site configuration'),
-      'callback' => 'drupal_get_form',
+      'callback' => image_gallery_is_using_views() ? 'image_gallery_admin_settings_empty' : 'drupal_get_form',
       'callback arguments' => array('image_gallery_admin_settings'),
       'type' => MENU_LOCAL_TASK,
       'description' => t('Configure appearance of image galleries.'),
@@ -74,6 +74,31 @@ function image_gallery_menu($may_cache) 
   return $items;
 }
 
+/**
+ ** Test whether we're using Views to generate galleries or not
+ **/
+function image_gallery_is_using_views() {
+  $views_status = variable_get('views_defaults', array());
+  return (
+    module_exists('views') && (
+      // taken from views.module code
+      $views_status['image_gallery'] == 'enabled' || 
+      (!$view->disabled && $views_status['image_gallery'] != 'disabled')
+    )
+  );
+}
+
+function image_gallery_admin_settings_empty() {
+  $text = 'Image galleries are being provided by the Views module.';
+  if (module_exists('views_ui')) {
+    $text .= t(' To change the way galleries are displayed, override the default image_gallery view at '). l(t('Administer views.'), 'admin/build/views');
+  }
+  else {
+    $text .= t(' To change the way galleries are displayed, enable the <strong>Views UI</strong> module and override the default image_gallery view.');
+  }
+  return $text;
+}
+
 function image_gallery_admin_settings() {
   _image_check_settings();
 
@@ -165,7 +190,7 @@ function image_gallery_page($type = NULL
      * - Embed a view to show the image gallery, appending it to the themed 
      *   child gallery list.
      */
-    if (module_exists('views')) {
+    if (image_gallery_is_using_views()) {
       $view = views_get_view('image_gallery');
     }
     else {
@@ -386,7 +411,7 @@ function theme_image_gallery($galleries,
   }
 
   // Skip this if using Views, as $images is always empty
-  if (!module_exists('views') && count($images) + count($galleries) == 0) {
+  if (!image_gallery_is_using_views() && count($images) + count($galleries) == 0) {
     $content .= '<p class="count">'. format_plural(0, 'There is 1 image in this gallery', 'There are @count images in this gallery') ."</p>\n";
   }
 
