Footprint Placement for Mosaic Imaging by Sampling and Optimization