--- a/bin/pto2gpano
+++ b/bin/pto2gpano
@@ -14,7 +14,6 @@
 
     my $path_jpg = $path_pto;
     $path_jpg =~ s/\.pto/.jpg/;
-    say "JPEG file: $path_jpg";
     next unless -e $path_jpg;
 
     my $pto = new Panotools::Script;
@@ -40,6 +39,13 @@
         $height = $crop[3] - $crop[2];
     }
 
+    my $full_width = $pto->Panorama->{w};
+    if ($pto->Panorama->{v} < 360)
+    {
+        $full_width = int (360 * $full_width / $pto->Panorama->{v});
+        $left += int (($full_width - $width) /2);
+    }
+
     my $path_first = $pto->Image->[0]->Path ($path_pto);
     my $path_last = $pto->Image->[-1]->Path ($path_pto);
 
@@ -51,13 +57,14 @@
     $exiftool->SetNewValue ('CroppedAreaTopPixels', $top);
     $exiftool->SetNewValue ('CroppedAreaImageWidthPixels', $width);
     $exiftool->SetNewValue ('CroppedAreaImageHeightPixels', $height);
-    $exiftool->SetNewValue ('FullPanoWidthPixels', $pto->Panorama->{w});
+    $exiftool->SetNewValue ('FullPanoWidthPixels', $full_width);
     $exiftool->SetNewValue ('FullPanoHeightPixels', $pto->Panorama->{h});
-    $exiftool->SetNewValue ('FirstPhotoDate', Image::ExifTool::ImageInfo ($path_first)->{DateTimeOriginal});
-    $exiftool->SetNewValue ('LastPhotoDate', Image::ExifTool::ImageInfo ($path_last)->{DateTimeOriginal});
+    $exiftool->SetNewValue ('FirstPhotoDate', Image::ExifTool::ImageInfo ($path_first)->{DateTimeOriginal}) if -e $path_first;
+    $exiftool->SetNewValue ('LastPhotoDate', Image::ExifTool::ImageInfo ($path_last)->{DateTimeOriginal}) if -e $path_last;
     $exiftool->SetNewValue ('SourcePhotosCount', scalar @{$pto->Image});
 
     $exiftool->WriteInfo ($path_jpg);
+    say "JPEG file: $path_jpg";
 }
 
 0;