def make_fits_image(imagedata, wcsobj, beam, freq, equinox, telescope, xmin
    =0, ymin=0, is_mask=False, shape=None):
    """Makes a simple FITS hdulist appropriate for single-channel images"""
    from distutils.version import StrictVersion
    try:
        from astropy.io import fits as pyfits
        use_header_update = False
    except ImportError as err:
        import pyfits
        if StrictVersion(pyfits.__version__) < StrictVersion('3.1'):
            use_header_update = True
        else:
            use_header_update = False
    import numpy as np
    if is_mask and shape is not None:
        shape_out = shape
    else:
        shape_out = [1, 1, imagedata.shape[0], imagedata.shape[1]]
    hdu = pyfits.PrimaryHDU(np.resize(imagedata, shape_out))
    hdulist = pyfits.HDUList([hdu])
    header = hdulist[0].header
    if use_header_update:
        header.update('CRVAL1', wcsobj.wcs.crval[0])
        header.update('CDELT1', wcsobj.wcs.cdelt[0])
        header.update('CRPIX1', wcsobj.wcs.crpix[0] + xmin)
        header.update('CUNIT1', str(wcsobj.wcs.cunit[0]).strip().lower())
        header.update('CTYPE1', wcsobj.wcs.ctype[0])
        header.update('CRVAL2', wcsobj.wcs.crval[1])
        header.update('CDELT2', wcsobj.wcs.cdelt[1])
        header.update('CRPIX2', wcsobj.wcs.crpix[1] + ymin)
        header.update('CUNIT2', str(wcsobj.wcs.cunit[1]).strip().lower())
        header.update('CTYPE2', wcsobj.wcs.ctype[1])
    else:
        header['CRVAL1'] = wcsobj.wcs.crval[0]
        header['CDELT1'] = wcsobj.wcs.cdelt[0]
        header['CRPIX1'] = wcsobj.wcs.crpix[0] + xmin
        header['CUNIT1'] = str(wcsobj.wcs.cunit[0]).strip().lower()
        header['CTYPE1'] = wcsobj.wcs.ctype[0]
        header['CRVAL2'] = wcsobj.wcs.crval[1]
        header['CDELT2'] = wcsobj.wcs.cdelt[1]
        header['CRPIX2'] = wcsobj.wcs.crpix[1] + ymin
        header['CUNIT2'] = str(wcsobj.wcs.cunit[1]).strip().lower()
        header['CTYPE2'] = wcsobj.wcs.ctype[1]
    if use_header_update:
        header.update('CRVAL3', 1.0)
        header.update('CDELT3', 1.0)
        header.update('CRPIX3', 1.0)
        header.update('CUNIT3', ' ')
        header.update('CTYPE3', 'STOKES')
    else:
        header['CRVAL3'] = 1.0
        header['CDELT3'] = 1.0
        header['CRPIX3'] = 1.0
        header['CUNIT3'] = ''
        header['CTYPE3'] = 'STOKES'
    if use_header_update:
        header.update('RESTFRQ', freq)
        header.update('CRVAL4', freq)
        header.update('CDELT4', 300000000.0)
        header.update('CRPIX4', 1.0)
        header.update('CUNIT4', 'HZ')
        header.update('CTYPE4', 'FREQ')
        header.update('SPECSYS', 'TOPOCENT')
    else:
        header['RESTFRQ'] = freq
        header['CRVAL4'] = freq
        header['CDELT4'] = 300000000.0
        header['CRPIX4'] = 1.0
        header['CUNIT4'] = 'HZ'
        header['CTYPE4'] = 'FREQ'
        header['SPECSYS'] = 'TOPOCENT'
    if not is_mask:
        if use_header_update:
            header.update('BMAJ', beam[0])
            header.update('BMIN', beam[1])
            header.update('BPA', beam[2])
        else:
            header['BMAJ'] = beam[0]
            header['BMIN'] = beam[1]
            header['BPA'] = beam[2]
    if use_header_update:
        header.update('EQUINOX', equinox)
    else:
        header['EQUINOX'] = equinox
    if telescope is not None:
        if use_header_update:
            header.update('TELESCOP', telescope)
        else:
            header['TELESCOP'] = telescope
    hdulist[0].header = header
    return hdulist
