Index: trunk/psModules/src/objects/pmFootprintCullPeaks.c
===================================================================
--- trunk/psModules/src/objects/pmFootprintCullPeaks.c	(revision 32977)
+++ trunk/psModules/src/objects/pmFootprintCullPeaks.c	(revision 32998)
@@ -122,5 +122,4 @@
                     threshbounds->data.F32[threshbounds->n-1], maxFlux);
         }
-
 	psHistogram *threshist = psHistogramAllocGeneric(threshbounds);
 
Index: trunk/psModules/src/objects/pmSourcePhotometry.c
===================================================================
--- trunk/psModules/src/objects/pmSourcePhotometry.c	(revision 32977)
+++ trunk/psModules/src/objects/pmSourcePhotometry.c	(revision 32998)
@@ -543,14 +543,19 @@
     int yChip = source->peak->y;
 
+    // need to access the parent if we are looking at a subimage (likely)
+    psImage *chipImage = (source->pixels == NULL) ? source->pixels : (psImage *) source->pixels->parent;
+
     bool onChip = true;
     onChip &= (xChip >= 0);
-    onChip &= (xChip < mask->numCols);
+    onChip &= (xChip < chipImage->numCols);
     onChip &= (yChip >= 0);
-    onChip &= (yChip < mask->numRows);
+    onChip &= (yChip < chipImage->numRows);
     if (!onChip) {
 	// if the source is off the edge of the chip, raise a different bit?
 	source->mode |= PM_SOURCE_MODE_OFF_CHIP;
     } else {
-	psImageMaskType maskValue = mask->data.PS_TYPE_IMAGE_MASK_DATA[yChip][xChip];
+	int xMask = xChip - mask->col0;
+	int yMask = yChip - mask->row0;
+	psImageMaskType maskValue = mask->data.PS_TYPE_IMAGE_MASK_DATA[yMask][xMask];
 	if (maskValue & maskGhost) {
 	    source->mode |= PM_SOURCE_MODE_ON_GHOST;
@@ -564,5 +569,4 @@
 	}
     }
-
     return (true);
 }
