Index: extensions/pLoader/trunk/src/Uploader/GUI/App.pm
===================================================================
--- extensions/pLoader/trunk/src/Uploader/GUI/App.pm	(revision 6709)
+++ extensions/pLoader/trunk/src/Uploader/GUI/App.pm	(revision 6726)
@@ -612,5 +612,4 @@
     );
 
-    print Dumper $self->localized_msg;
 
 }
@@ -910,13 +909,13 @@
 
     if($self->is_single_instance_running){
-        printf("connect_to_single_instance_server\n");
+        #printf("connect_to_single_instance_server\n");
         $self->connect_to_single_instance_server;
-        printf("connected to single_instance_server\n");
+        #printf("connected to single_instance_server\n");
         return 0;
     }
     else{
-        printf("start_single_instance_server\n");
+        #printf("start_single_instance_server\n");
         $self->start_single_instance_server;
-        printf("single_instance_server started\n");
+        #printf("single_instance_server started\n");
         return 1;
     }
@@ -1312,4 +1311,20 @@
 }
 
+
+sub check_existing {
+    my ( $self, $all ) = @_;
+
+    my $check = $self->pwg->IsAlreadyUploaded(
+        $self->images->selection_image_ids($all)
+    );
+
+    $self->images->set_pwg_id($check);
+
+    my $existing = [ 
+        grep { $_ } values %$check
+    ];
+
+    scalar @$existing;
+}
 
 sub init_transfer_batch_end_event_handler {
Index: extensions/pLoader/trunk/src/Uploader/GUI/Frame.pm
===================================================================
--- extensions/pLoader/trunk/src/Uploader/GUI/Frame.pm	(revision 6709)
+++ extensions/pLoader/trunk/src/Uploader/GUI/Frame.pm	(revision 6726)
@@ -1073,5 +1073,4 @@
             my ( $handler, $event ) = @_;
             my $data = $event->GetData;
-printf("image_done_event %s\n", Dumper $data);
             if($data->{preferences}{remove_uploaded_from_selection}){
                 my $gr = $data->{global_rank};
@@ -1555,5 +1554,63 @@
     }
 
+    # check if update/insert
+    my $existing = wxTheApp->check_existing($all_images);
+    $self->show_reupload_options if $existing;
+
+
     wxTheApp->start_resize($all_images);
+
+}
+
+
+sub show_reupload_options {
+    my ( $self ) = @_;
+
+    Uploader::GUI::wxImageReuploadDlg->new(
+        { 
+            title => gettext("Photo update management"),
+            properties => 
+            {
+                $main::ID_REUPLOAD_ACTION_FILES => 
+                {
+                    selection=>sub {$self->preferences->reupload_action_files(@_)},
+                    label=>gettext("What shall we do with files? (thumbnail, resized, high resolution)"),
+                    labels=>[
+                        gettext("nothing"),
+                        gettext("replace"),
+                    ],
+                },
+                $main::ID_REUPLOAD_ACTION_PROPERTIES => 
+                { 
+                    selection=>sub{$self->preferences->reupload_action_properties(@_)},
+                    label=>gettext("What shall we do with single value properties?(caption, comment, author, create date)"),
+                    labels=>[
+                        gettext("nothing"),
+                        gettext("fill if empty (only replace properties currently empty in Piwigo)"),
+                        gettext("replace"),
+                    ],
+                },
+                $main::ID_REUPLOAD_ACTION_PROPERTIES_M =>
+                { 
+                    selection=>sub{$self->preferences->reupload_action_properties_m(@_)},
+                    label=>gettext("What shall we do with multiple values properties? (categories, tags)"),
+                    labels=>[
+                        gettext("nothing"),
+                        gettext("append (keep existing and add new)"),
+                        gettext("replace"),
+                    ],
+                },
+                $main::ID_REUPLOAD_NOT_ASK => 
+                { 
+                    value=>sub{$self->preferences->reupload_not_ask(@_)}, 
+                    label=>gettext("Do not ask me again"),
+                },
+                $main::ID_REUPLOAD_TEXT => 
+                { 
+                    label=>gettext("A least one photo has already been added in the past."),
+                },
+            },
+        } 
+    )->ShowModal();
 
 }
Index: extensions/pLoader/trunk/src/Uploader/Image.pm
===================================================================
--- extensions/pLoader/trunk/src/Uploader/Image.pm	(revision 6709)
+++ extensions/pLoader/trunk/src/Uploader/Image.pm	(revision 6726)
@@ -45,4 +45,5 @@
     caption
     global_rank
+    pwg_image_id
 /;
 
Index: extensions/pLoader/trunk/src/Uploader/Images.pm
===================================================================
--- extensions/pLoader/trunk/src/Uploader/Images.pm	(revision 6709)
+++ extensions/pLoader/trunk/src/Uploader/Images.pm	(revision 6726)
@@ -269,5 +269,5 @@
 sub _remove_selection {
     my ( $self, $list ) = @_;
-    printf("_remove_selection %s\n", Dumper $list);
+
     # the list is sorted, ascendant
     # we reverse it to have
@@ -547,14 +547,7 @@
     my ( $self, $preferences, $destination_category, $all ) = @_;
 
-    my $image_id_list = $all ?
-        $self->ordered_image_ids :
-        [
-            map {
-                $self->ordered_image_ids->[$_]
-            }@{$self->selection}
-        ];
 
     $self->get_images_data(
-        $image_id_list,
+        $self->selection_image_ids($all),
         $preferences,
         $destination_category
@@ -562,4 +555,26 @@
 }
 
+
+sub selection_image_ids {
+    my ( $self, $all ) = @_;
+
+    $all ?
+    $self->ordered_image_ids :
+    [
+        map {
+            $self->ordered_image_ids->[$_]
+        }@{$self->selection}
+    ];
+}
+
+
+# set piwigo id for already uploaded images.
+sub set_pwg_id {
+    my ( $self, $pwg_ids ) = @_;
+
+    map {
+        $self->_images->{$_}->{pwg_image_id} = $pwg_ids->{$_};
+    } @{$self->ordered_image_ids};
+}
 
 my $add_rank = 0;
Index: extensions/pLoader/trunk/src/Uploader/Preferences.pm
===================================================================
--- extensions/pLoader/trunk/src/Uploader/Preferences.pm	(revision 6709)
+++ extensions/pLoader/trunk/src/Uploader/Preferences.pm	(revision 6726)
@@ -47,4 +47,5 @@
     reupload_action_properties
     reupload_action_properties_m
+    reupload_not_ask
     display_mode
     thumbnail_shape_square
Index: extensions/pLoader/trunk/src/Uploader/ResizeWorker.pm
===================================================================
--- extensions/pLoader/trunk/src/Uploader/ResizeWorker.pm	(revision 6709)
+++ extensions/pLoader/trunk/src/Uploader/ResizeWorker.pm	(revision 6726)
@@ -81,7 +81,13 @@
     );
 
-    $self->resize_image($image);
-    $self->process_high_image($image);
-    $self->thumbnail_image($image);
+    $image->{update_files} = defined $image->{pwg_image_id} ?
+        $image->{preferences}{reupload_action_files} :
+        1;
+
+    if($image->{update_files}){
+        $self->resize_image($image);
+        $self->process_high_image($image);
+        $self->thumbnail_image($image);
+    }
 
     $self->post_image_done_event($image);
Index: extensions/pLoader/trunk/src/Uploader/TransferWorker.pm
===================================================================
--- extensions/pLoader/trunk/src/Uploader/TransferWorker.pm	(revision 6709)
+++ extensions/pLoader/trunk/src/Uploader/TransferWorker.pm	(revision 6726)
@@ -164,6 +164,8 @@
     $self->post_image_progress_event($image);
 
-    $self->update_image_files($image);
-    $self->post_image_progress_event($image);
+    if($image->{update_files}){
+        $self->update_image_files($image);
+        $self->post_image_progress_event($image);
+    }
 
     $self->update_image_properties($image);
