diff --git a/libgd b/libgd
index a0717ad..7c12355 160000
--- a/libgd
+++ b/libgd
@@ -1 +1 @@
-Subproject commit a0717ad8c078c07ea9d10aed385d30198fd24b03
+Subproject commit 7c1235591c4aa866b28c8b8dabdcb3b9084c5763
diff --git a/src/photos-application.c b/src/photos-application.c
index 45e7bbf..ed261d5 100644
--- a/src/photos-application.c
+++ b/src/photos-application.c
@@ -738,6 +738,7 @@ photos_application_edit_current (PhotosApplication *self)
   item = PHOTOS_BASE_ITEM (photos_base_manager_get_active_object (priv->state->item_mngr));
   g_return_if_fail (item != NULL);
 
+  photos_base_item_pipeline_snapshot (item);
   photos_mode_controller_set_window_mode (priv->state->mode_cntrlr, PHOTOS_WINDOW_MODE_EDIT);
 }
 
diff --git a/src/photos-base-item.c b/src/photos-base-item.c
index 2f6fd38..bb1301c 100644
--- a/src/photos-base-item.c
+++ b/src/photos-base-item.c
@@ -2175,6 +2175,12 @@ photos_base_item_operation_remove (PhotosBaseItem *self, const gchar *operation)
   return photos_pipeline_remove (self->priv->pipeline, operation);
 }
 
+void
+photos_base_item_pipeline_snapshot (PhotosBaseItem *self)
+{
+  return photos_pipeline_snapshot (self->priv->pipeline);
+}
+
 
 void
 photos_base_item_operations_revert (PhotosBaseItem *self)
diff --git a/src/photos-base-item.h b/src/photos-base-item.h
index 5207ce2..87cd93e 100644
--- a/src/photos-base-item.h
+++ b/src/photos-base-item.h
@@ -208,6 +208,8 @@ gboolean            photos_base_item_pipeline_save_finish    (PhotosBaseItem *se
                                                               GAsyncResult *res,
                                                               GError **error);
 
+void                photos_base_item_pipeline_snapshot       (PhotosBaseItem *self);
+
 void                photos_base_item_print                   (PhotosBaseItem *self, GtkWidget *toplevel);
 
 void                photos_base_item_process_async           (PhotosBaseItem *self,
diff --git a/src/photos-pipeline.c b/src/photos-pipeline.c
index cc05c5e..b866f16 100644
--- a/src/photos-pipeline.c
+++ b/src/photos-pipeline.c
@@ -37,6 +37,7 @@ struct _PhotosPipeline
   GeglNode *parent;
   GHashTable *hash;
   GeglNode *graph;
+  gchar *snapshot;
   gchar *uri;
 };
 
@@ -225,6 +226,7 @@ photos_pipeline_finalize (GObject *object)
 {
   PhotosPipeline *self = PHOTOS_PIPELINE (object);
 
+  g_free (self->snapshot);
   g_free (self->uri);
 
   G_OBJECT_CLASS (photos_pipeline_parent_class)->finalize (object);
@@ -288,6 +290,14 @@ photos_pipeline_class_init (PhotosPipelineClass *class)
 }
 
 
+void
+photos_pipeline_snapshot (PhotosPipeline *self)
+{
+  g_free (self->snapshot);
+  self->snapshot = gegl_node_to_xml_full (self->graph, self->graph, "/");
+}
+
+
 static void
 photos_pipeline_async_initable_init_load_contents (GObject *source_object, GAsyncResult *res, gpointer user_data)
 {
@@ -587,27 +597,11 @@ photos_pipeline_remove (PhotosPipeline *self, const gchar *operation)
 void
 photos_pipeline_revert (PhotosPipeline *self)
 {
-  GeglNode *input;
-  GeglNode *last;
-  GeglNode *output;
-  gchar *xml;
-
-  input = gegl_node_get_input_proxy (self->graph, "input");
-  output = gegl_node_get_output_proxy (self->graph, "output");
-  last = gegl_node_get_producer (output, "input", NULL);
-
-  g_hash_table_remove_all (self->hash);
-
-  while (last != NULL && last != input)
+  if (self->snapshot)
     {
-      gegl_node_remove_child (self->graph, last);
-      last = gegl_node_get_producer (output, "input", NULL);
+      g_hash_table_remove_all (self->hash);
+      photos_pipeline_create_graph_from_xml (self, self->snapshot);
     }
-
-  gegl_node_link (input, output);
-
-  xml = gegl_node_to_xml_full (self->graph, self->graph, "/");
-  photos_debug (PHOTOS_DEBUG_GEGL, "Pipeline: %s", xml);
-
-  g_free (xml);
+  photos_debug (PHOTOS_DEBUG_GEGL, "Pipeline: %s", self->snapshot);
+  g_free (self->snapshot);
 }
diff --git a/src/photos-pipeline.h b/src/photos-pipeline.h
index 3def045..377ebf9 100644
--- a/src/photos-pipeline.h
+++ b/src/photos-pipeline.h
@@ -91,6 +91,8 @@ gboolean               photos_pipeline_remove            (PhotosPipeline *self,
 
 void                   photos_pipeline_revert            (PhotosPipeline *self);
 
+void                   photos_pipeline_snapshot          (PhotosPipeline *self);
+
 G_END_DECLS
 
 #endif /* PHOTOS_PIPELINE_H */
