Write WCS headers to residual FITS images; plot chi histogram