gaia: handle case when mask and image have different data formats

Previously using a FITS mask on an NDF would give NaN instead of BAD values