<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def upload_from_fs(fn, profile=None, label=None):
 """ Saves image from fn with TMP prefix and returns img_id. """

    if not os.path.isfile(fn):
        raise ValueError('File is not exists: {}'.format(fn))
    if profile is None:
        profile = 'default'
    conf = get_profile_configs(profile)
    with open(fn, 'rb') as f:
        if not is_image(f, types=conf['TYPES']):
            msg = (('Format of uploaded file "%(name)s" is not allowed. '
                    'Allowed formats is: %(formats)s.') %
                   {'name': fn, 'formats': ', '.join(map(lambda t: t.upper(), conf['TYPES']))})
            raise RuntimeError(msg)
        return _custom_upload(f, profile, label, conf)