diff --git a/src/BatchImport.vala b/src/BatchImport.vala
index 4a46a26..af4a698 100644
--- a/src/BatchImport.vala
+++ b/src/BatchImport.vala
@@ -1054,7 +1054,7 @@ public class BatchImport : Object {
                         d = RawDeveloper.EMBEDDED;
                     
                     photo.set_default_raw_developer(d);
-                    photo.set_raw_developer(d);
+                    //photo.set_raw_developer(d);
                 }
             }
             
diff --git a/src/db/PhotoTable.vala b/src/db/PhotoTable.vala
index 5be08e7..0fdf2fb 100644
--- a/src/db/PhotoTable.vala
+++ b/src/db/PhotoTable.vala
@@ -158,6 +158,11 @@ public class PhotoTable : DatabaseTable {
         if (res2 != Sqlite.DONE)
             fatal("create photo table", res2);
 
+        db.exec ("CREATE UNIQUE INDEX IF NOT EXISTS mmarkk1 on PhotoTable (filename);");
+        db.exec ("CREATE UNIQUE INDEX IF NOT EXISTS mmarkk2 on PhotoTable (thumbnail_md5, file_format);");
+        db.exec ("CREATE UNIQUE INDEX IF NOT EXISTS mmarkk3 on PhotoTable (md5, file_format);");
+        db.exec ("CREATE UNIQUE INDEX IF NOT EXISTS mmarkk4 on PhotoTable (md5, thumbnail_md5, file_format);");
+
         set_table_name("PhotoTable");
     }
     
diff --git a/src/photos/GRaw.vala b/src/photos/GRaw.vala
index ec1df8d..c3e7cca 100644
--- a/src/photos/GRaw.vala
+++ b/src/photos/GRaw.vala
@@ -120,7 +120,7 @@ public class ProcessedImage {
         image = proc.make_mem_thumb(ref result);
         throw_exception("ProcessedImage.from_thumb", result);
         assert(image != null);
-        
+
         // A mem thumb comes back as the raw bytes from the data segment in the file -- this needs
         // to be decoded before being useful.  This will throw an error if the format is not
         // supported
diff --git a/src/photos/RawSupport.vala b/src/photos/RawSupport.vala
index 441b899..da94418 100644
--- a/src/photos/RawSupport.vala
+++ b/src/photos/RawSupport.vala
@@ -249,10 +249,10 @@ public class RawReader : PhotoFileReader {
         processor.output_params->user_flip = GRaw.Flip.NONE;
         
         processor.open_file(get_filepath());
-        processor.unpack();
-        processor.process();
+        processor.unpack_thumb();
+//        processor.process();
         
-        GRaw.ProcessedImage image = processor.make_mem_image();
+        GRaw.ProcessedImage image = processor.make_thumb_image();
         
         return resize_pixbuf(image.get_pixbuf_copy(), scaled, Gdk.InterpType.BILINEAR);
     }
