diff --git a/src/eog-image.c b/src/eog-image.c
index b11c8cb..1ff747b 100644
--- a/src/eog-image.c
+++ b/src/eog-image.c
@@ -1659,6 +1659,37 @@ tmp_file_restore_unix_attributes (GFile *temp_file,
 	g_object_unref (file_info);
 }
 
+static GFile *
+get_right_file (GFile *file)
+{
+        GError *error;
+        GFileInfo *file_info = g_file_query_info(file,
+                                                 G_FILE_ATTRIBUTE_STANDARD_SYMLINK_TARGET ","
+                                                 G_FILE_ATTRIBUTE_STANDARD_IS_SYMLINK,
+                                                 G_FILE_QUERY_INFO_NONE,
+                                                 NULL,
+                                                 &error);
+
+        if (g_error_matches(error, G_IO_ERROR,
+                            G_IO_ERROR_NOT_FOUND)) {
+            g_object_unref(file_info);
+            return NULL;
+        }
+
+        if (!g_file_info_get_is_symlink(file_info)) {
+            g_object_unref(file_info);
+            return file;
+        }
+
+        GFile *realFile = g_file_resolve_relative_path(g_file_get_parent(file),
+                                                       g_file_info_get_symlink_target(file_info));
+        g_object_unref(file_info);
+        g_object_unref(file);
+
+
+        return realFile;
+}
+
 static gboolean
 tmp_file_move_to_uri (EogImage *image,
 		      GFile *tmpfile,
@@ -1669,12 +1700,14 @@ tmp_file_move_to_uri (EogImage *image,
 	gboolean result;
 	GError *ioerror = NULL;
 
+        GFile *rightFile = get_right_file(file);
+
 	/* try to restore target file unix attributes */
-	tmp_file_restore_unix_attributes (tmpfile, file);
+	tmp_file_restore_unix_attributes (tmpfile, rightFile);
 
 	/* replace target file with temporal file */
 	result = g_file_move (tmpfile,
-			      file,
+			      rightFile,
 			      (overwrite ? G_FILE_COPY_OVERWRITE : 0) |
 			      G_FILE_COPY_ALL_METADATA,
 			      NULL,
@@ -1695,7 +1728,6 @@ tmp_file_move_to_uri (EogImage *image,
 		}
 		g_clear_error (&ioerror);
 	}
-
 	return result;
 }
 
