Index: bin/booh-backend
===================================================================
RCS file: /opt/cvs/booh/bin/booh-backend,v
retrieving revision 1.89
diff -u -r1.89 booh-backend
--- bin/booh-backend	15 Jul 2006 12:15:55 -0000	1.89
+++ bin/booh-backend	31 Jul 2006 11:44:46 -0000
@@ -420,7 +420,8 @@
     html_reload_to_thumbnails.gsub!(/~~default_size~~/, $default_size['name'])
     html_reload_to_thumbnails.gsub!(/~~all_sizes~~/, all_images_sizes.collect { |s| "\"#{size2js(s['name'])}\"" }.join(', '))
     size_auto_chooser = '';
-    all_images_sizes.sort { |a,b| b['optimizedforwidth'].to_i <=> a['optimizedforwidth'].to_i }.
+    all_images_sizes.find_all { |s| s.has_key?('optimizedforwidth') }.
+                     sort { |a,b| b['optimizedforwidth'].to_i <=> a['optimizedforwidth'].to_i }.
                      each { |s| size_auto_chooser += "if (w + 50 > #{s['optimizedforwidth']}) { return 'thumbnails-#{size2js(s['name'])}-0.html'; }\n" }
     html_reload_to_thumbnails.gsub!(/~~size_auto_chooser~~/, size_auto_chooser)
     return html_reload_to_thumbnails

