Routines for automatically extracting photometry from a set of images