Index: imce_search.css
===================================================================
--- imce_search.css	(revision 242)
+++ imce_search.css	(working copy)
@@ -1,6 +1,5 @@
 #imce-search-results div {
   font-weight: bold;
-  margin: 1em;
 }
 
 #imce-search-results div a {
@@ -11,3 +10,32 @@
   background: url('loading.gif') no-repeat top left;
   padding-left: 20px;
 }
+
+#search-file-wrapper {
+    max-height: 308px;
+    overflow-x: hidden;
+    overflow-y: auto;
+}
+
+#search-file-list td.name {
+    height: 132px;
+    width: 132px;
+
+    min-width: 0;
+    padding: 5px;
+    text-align: center;
+    vertical-align: middle;
+}
+
+#search-file-list tr {
+    border: 1px solid #CCCCFF;
+    display: block;
+    float: left;
+    margin: 10px;
+}
+
+#search-file-list tr:hover td {
+    background-color: #e9ecef;
+}
+
+
Index: imce_search.js
===================================================================
--- imce_search.js	(revision 242)
+++ imce_search.js	(working copy)
@@ -4,6 +4,79 @@
     title : 'Search',
     content : $('#imce-search-form')
   });
+
+  var currentFile = false;
+  var stackDir = [];
+  var stackIndex = false;
+
+  /**
+   * Chacks if directory exists in imce and fires navigation
+   * @param dir
+   */
+  var fireNavigation = function (dir) {
+    if (imce.tree[stackDir[stackIndex]]) {
+      imce.navigate(stackDir[stackIndex]);
+    }
+    else {
+      // directory does not exist, reset navigation variables
+      stackDir = [];
+      stackIndex = false;
+      currentFile = false;
+    }
+  }
+
+  // Breaks the path intro dirs and starts the navigation
+  var navigate = function (dir) {
+    var dirs = dir.split('/');
+    var build = '';
+    stackDir = [];
+    for(var i = 0; i < dirs.length; i++) {
+      if (build) build += '/';
+      build += dirs[i];
+
+      stackDir.push(build);
+    }
+    stackIndex = 0;
+    // navigate to the first folder in the path
+    if (stackDir[stackIndex] != imce.conf.dir) {
+      fireNavigation(stackDir[stackIndex]);
+    }
+    else {
+      if (stackDir.length - 1 > stackIndex) {
+        stackIndex++;
+        fireNavigation(stackDir[stackIndex]);
+      }
+
+      if (currentFile) {
+        imce.highlight(currentFile);
+        currentFile = false;
+      }
+    }
+  }
+
+  // Hook navigate event
+  imce.hooks['navigate'].push(function () {
+    // We still have to naivgate to the target dir
+    if (stackIndex !== false) {
+      if (stackDir.length - 1 > stackIndex) {
+        stackIndex ++;
+        if (stackDir[stackIndex] != imce.conf.dir) {
+          imce.vars.navbusy = null;
+          fireNavigation(stackDir[stackIndex]);
+        }
+      }
+      else {
+        stackIndex = false;
+        stackDir = [];
+
+        if (currentFile) {
+          imce.highlight(currentFile);
+          currentFile = false;
+        }
+      }
+    }
+  });
+
   $('#imce-search-form').submit(function() {
     $('#imce-search-results div').html('Searching ' + ((imce.conf.dir == '.') ? 'all ' : imce.conf.dir + ' and sub') +'directories for ' + $('#edit-imce-search-term').val());
     $('#imce-search-results div').addClass('loading');
@@ -14,39 +87,17 @@
       type: 'text',
       success: function(serverdata, status, xmlhttp) {
         data = eval('(' + serverdata + ')');
-        var filelist = $.map(data.files, function(fullpath, index) {
-          var li = document.createElement('li');
-          /*$(li).click(function () { 
-            file = fullpath.substr(fullpath.lastIndexOf('/') + 1);
-            dir = fullpath.substr(0, fullpath.lastIndexOf('/'));
-            imce.dirActivate(dir);
-            imce.highlight(file);
-          });*/
-          if (index > 10) {
-            $(li).addClass('toggle');
-          }
-          $(li).html(fullpath);
-          return li;
+        $('#imce-search-results div').html(data.search + '. ' + data.files.length + ' results found. ');
+        $('#imce-search-results div').append(data.html);
+        $('#imce-search-results tr').click(function (i) {
+          var filepath = $(this).attr('id');
+          var file = data.files[filepath];
+
+          currentFile = file.filename;
+          // navigate to file dir
+          navigate(file.filedir);
         });
-        $('#imce-search-results ul').hide();
-        $('#imce-search-results ul').empty().append(filelist);
-        $('#imce-search-results ul li[class="toggle"]').hide();
-        $('#imce-search-results ul').show();
-        $('#imce-search-results div').html(data.search + '. ' + data.files.length + ' results found. ');
-        if (data.files.length > 10) {
-          var toggle =  document.createElement('a');
-          $(toggle).append('Show all');
-          $(toggle).toggle(function () {
-              $(this).html('Short list');
-              $('#imce-search-results ul li[class*="toggle"]').show();
-            },
-            function () {
-              $(this).html('Show all');
-              $('#imce-search-results ul li[class*="toggle"]').hide();
-            }
-          );
-          $('#imce-search-results div').append(toggle);
-        }
+
         $('#imce-search-results div').removeClass('loading');
       }
     });
Index: imce_search.module
===================================================================
--- imce_search.module	(revision 242)
+++ imce_search.module	(working copy)
@@ -14,12 +14,18 @@
   return $menu;
 }
 
+function imce_search_file_is_image($file) {
+  $file = (object)$file;
+  return in_array($file->filemime, array('image/jpg', 'image/pjpeg', 'image/jpeg', 'image/png', 'image/gif'));
+}
+
 function imce_search_callback() {
   $path_parts = explode('/', $_GET['q']);
   array_shift($path_parts); // get rid of callback dir
   $case_insensitive = array_shift($path_parts);
   $file_string = array_pop($path_parts);
-  $dir_base = join('/', $path_parts);
+//  $dir_base = join('/', $path_parts);
+  $dir_base = null;
   $query_args = array();
   if ($file_string) {
     if ($case_insensitive) {
@@ -30,7 +36,7 @@
       $file_column = 'filename';
       $query_args[]= $file_string;
     }
-    $sql = sprintf('SELECT * FROM {files} WHERE %s', $file_column) . " like('%%%s%%')";
+    $sql = sprintf('SELECT * FROM {files} WHERE %s', $file_column) . " like('%%%s%%') LIMIT 50";
     if ($dir_base) {
       $sql .= ' AND filepath like(\'%s%%\')';
       $query_args[] = file_directory_path() . '/' . $dir_base;
@@ -39,9 +45,19 @@
     $suggestions['files'] = array();
 
     $res = db_query($sql, $query_args);
+    $fileDirectory = file_directory_path();
+    $fileDirectoryLen = strlen($fileDirectory);
     while ($row = db_fetch_object($res)) {
-      $suggestions['files'][] = $row->filepath;
+      $row->is_image = imce_search_file_is_image($row);
+      $dir = dirname($row->filepath);
+      if (strpos($row->filepath, $fileDirectory) === 0) {
+        $dir = substr($dir, $fileDirectoryLen + 1);
+      }
+      $row->filedir = $dir;
+
+      $suggestions['files'][rawurlencode($row->filepath)] = $row;
     }
+    $suggestions['html'] = theme('imce_search_file_list', $suggestions['files']);
   }
   else {
     $suggestions['search'] = 'Invalid search criteria, please specify a search';
@@ -84,3 +100,16 @@
   return drupal_get_form('imce_search_form');
 }
 
+/**
+ * Implementation of hook_theme().
+ */
+function imce_search_theme() {
+  $path = drupal_get_path('module', 'imce_search') .'/tpl';
+  $theme['imce_search_file_list'] = array(
+    'template' => 'imce-search-file-list',
+    'arguments' => array('files' => NULL),
+    'path' => $path,
+  );
+  return $theme;
+}
+
Index: tpl/imce-search-file-list.tpl.php
===================================================================
--- tpl/imce-search-file-list.tpl.php	(revision 0)
+++ tpl/imce-search-file-list.tpl.php	(working copy)
@@ -0,0 +1,19 @@
+<div id="search-file-wrapper">
+    <table id="search-file-list" class="files">
+        <tbody><?php
+        if (!empty($files)) {
+          foreach ($files as $index => $file) {
+            ?>
+          <tr id="<?php print $raw = rawurlencode($file->filepath); ?>">
+              <td class="name">
+                <?php if ($file->is_image): ?>
+                <?php echo theme('imagecache', 'thumbnail', $file->filepath); ?>
+                <?php endif; ?>
+                <?php print $raw = rawurlencode($file->filename); ?>
+              </td>
+          </tr><?php
+          }
+        }?>
+        </tbody>
+    </table>
+</div>
\ No newline at end of file
