Index: trunk/pstamp/scripts/pstamp_get_image_job.pl
===================================================================
--- trunk/pstamp/scripts/pstamp_get_image_job.pl	(revision 36018)
+++ trunk/pstamp/scripts/pstamp_get_image_job.pl	(revision 36048)
@@ -65,5 +65,7 @@
 my $mdcParser = PS::IPP::Metadata::Config->new; # Parser for metadata config files
 
-my $data = $mdcParser->parse(join "", (<INPUT>)) or my_die("failed to parse metadata config doc", $PS_EXIT_UNKNOWN_ERROR);
+my $data = $mdcParser->parse(join "", (<INPUT>)) 
+    or my_die("failed to parse metadata config doc", $PS_EXIT_UNKNOWN_ERROR);
+
 my $components = parse_md_list($data);
 my $n = scalar @$components;
@@ -83,5 +85,4 @@
     print STDERR "stage_id is $stage_id\n";
     print STDERR "path_base is $path_base\n";
-    print STDERR "path_base is $path_base\n";
     print STDERR "CAMERA is $camera\n";
     print STDERR "magicked is " . (defined $magicked ? $magicked : "undefined") . "\n";
@@ -89,5 +90,5 @@
 
 if (!$camera or !$path_base or !$component or !$stage_id or !$stage) {
-       my_die("failed to parse params from: $params_file", $PS_EXIT_UNKNOWN_ERROR);
+       my_die("One or more parameters are missing in: $params_file", $PS_EXIT_UNKNOWN_ERROR);
 }
 
Index: trunk/pstamp/scripts/pstamp_job_run.pl
===================================================================
--- trunk/pstamp/scripts/pstamp_job_run.pl	(revision 36018)
+++ trunk/pstamp/scripts/pstamp_job_run.pl	(revision 36048)
@@ -562,4 +562,7 @@
 }
 
+# stack_summary stage does not currently use proper file rules.
+# The parser defers handlint this to us..
+
 sub update_stack_summary_filenames {
     my $params  = shift;
@@ -570,7 +573,7 @@
     $params->{mask}   = $path_base . ".mask.b1.fits";
     $params->{weight} = $path_base . ".variance.b1.fits";
+    $params->{jpeg}   = $path_base . ".image.0.b1.jpeg";
     $params->{exp}    = $path_base . ".exp.b1.fits";
     $params->{num}    = $path_base . ".num.b1.fits";
-
 }
 
@@ -580,5 +583,6 @@
     my $result;
     my $resolved = $ipprc->file_resolve($src);
-    if ($ipprc->file_exists($resolved)) {
+    if ($resolved and $ipprc->file_exists($resolved)) {
+        print "Copying $src to $dest\n" if $verbose;;
         $result = copy($resolved, $dest);
     } else {
@@ -602,4 +606,6 @@
     my ($outputBase, $r_options, $params) = @_;
 
+    print "Just copying files for $job_id.\n";
+
     my $options = $$r_options;
     if ($options & $PSTAMP_SELECT_IMAGE) {
@@ -616,4 +622,9 @@
         }
     }
+    if ($options & $PSTAMP_SELECT_JPEG) {
+        if (!myCopy("$outputBase.jpg", $params->{jpeg}, 'jpeg', 0)) {
+            $options &= ~$PSTAMP_SELECT_JPEG;
+        }
+    }
     if ($options & $PSTAMP_SELECT_EXP) {
         if (!myCopy("$outputBase.exp.fits", $params->{exp}, 'exp', 0)) {
@@ -628,4 +639,6 @@
 
     $$r_options = $options;
+
+    print "Done with copy.\n";
 
     return 0;
Index: trunk/pstamp/scripts/pstampparse.pl
===================================================================
--- trunk/pstamp/scripts/pstampparse.pl	(revision 36018)
+++ trunk/pstamp/scripts/pstampparse.pl	(revision 36048)
@@ -297,6 +297,9 @@
     }
     if ($job_type eq 'get_image') {
-        unless ($req_type eq 'byid' or $req_type eq 'byexp' or ($req_type eq 'byskycell' and $stage eq 'stack')) {
-            print STDERR "REQ_TYPE must be 'byid' or 'byexp' or byskcyell for stacks for JOB_TYPE 'get_image'\n";
+        # get_image jobs are quite expensive in terms of space so we are currently restricting them
+        unless ($req_type eq 'byid' or $req_type eq 'byexp' 
+            or ($req_type eq 'byskycell' and $stage eq 'stack')
+            or ($stage eq 'stack_summary')) {
+            print STDERR "REQ_TYPE must be 'byid' or 'byexp' JOB_TYPE 'get_image' for IMG_TYPE $stage\n";
             insertFakeJobForRow($row, 1, $PSTAMP_INVALID_REQUEST);
             return 0;
@@ -306,5 +309,5 @@
     my $component = $row->{COMPONENT};
     if (!defined $component or (lc($component) eq "null") or (lc($component) eq "all")) {
-        if ($job_type eq 'get_image') {
+        if ($job_type eq 'get_image' and ! ($stage eq 'stack' or $stage eq 'stack_summary')) {
             $row->{COMPONENT} = 'all';
         } else {
