Get list of available images

    CLI Example:

    .. code-block:: bash

        salt-cloud --list-images

    Can use a custom URL for images. Default is:

    .. code-block:: yaml

        image_url: images.joyent.com/images

def avail_images(call=None):
    '''
    Get list of available images

    CLI Example:

    .. code-block:: bash

        salt-cloud --list-images

    Can use a custom URL for images. Default is:

    .. code-block:: yaml

        image_url: images.joyent.com/images
    '''
    if call == 'action':
        raise SaltCloudSystemExit(
            'The avail_images function must be called with '
            '-f or --function, or with the --list-images option'
        )

    user = config.get_cloud_config_value(
        'user', get_configured_provider(), __opts__, search_global=False
    )

    img_url = config.get_cloud_config_value(
        'image_url',
        get_configured_provider(),
        __opts__,
        search_global=False,
        default='{0}{1}/{2}/images'.format(DEFAULT_LOCATION, JOYENT_API_HOST_SUFFIX, user)
    )

    if not img_url.startswith('http://') and not img_url.startswith('https://'):
        img_url = '{0}://{1}'.format(_get_proto(), img_url)

    rcode, data = query(command='my/images', method='GET')
    log.debug(data)

    ret = {}
    for image in data:
        ret[image['name']] = image
    return ret