Crop images around foreground area, new tool for subsampling images, fix bugs in 'segment'