Add DB stuff for getting comasters and masters

where masters are *-m.tiff and comasters are *-c.tiff
Wee bit of tidying