Index: trunk/pstamp/scripts/pstampparse.pl
===================================================================
--- trunk/pstamp/scripts/pstampparse.pl	(revision 20220)
+++ trunk/pstamp/scripts/pstampparse.pl	(revision 20221)
@@ -192,4 +192,8 @@
             $x, $y, $mjd_min, $mjd_max, $filter);
 
+    if (!$images) {
+        print STDERR "no matching images found\n";
+        exit $PS_EXIT_DATA_ERROR;
+    }
     if ($mode eq "list_uri") {
         foreach my $image (@$images) {
@@ -201,9 +205,20 @@
         my $listfile = "$out_dir/filelist";
 
+
+        # map our img_type to the Data Store file types.
+        my %filelist_img_types = ( "raw" => "chip", 
+                                   "chip" => "chipproc",
+                                   "warp" => "warp", 
+                                   "stack"=>"stack",
+                                   "diff" => "diff");
+
+        my $filelist_img_type = $filelist_img_types{$img_type};
+
         open LISTFILE, ">$listfile"
             or die "failed to open file list: $listfile while parsing get_image request $req_id";
 
         foreach my $image (@$images) {
-            print LISTFILE "$image->{image}|$img_type\n";
+            my $class_id = $image->{class_id} ? $image->{class_id} : "";
+            print LISTFILE "$image->{image}|$filelist_img_type|$class_id|\n";
         }
         close LISTFILE;
@@ -234,4 +249,5 @@
             my $uri = $image->{image};
             my $exp_id = $image->{exp_id};
+            
 
             $job_num++;
