<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def update_thumbnail_via_upload(api_key, api_secret, video_key, local_video_image_path='', api_format='json', **kwargs):
 """ Function which updates the thumbnail for a particular video object with a locally saved image. :param api_key: <string> JWPlatform api-key :param api_secret: <string> JWPlatform shared-secret :param video_key: <string> Video's object ID. Can be found within JWPlayer Dashboard. :param local_video_image_path: <string> Local system path to an image. :param api_format: <string> REQUIRED Acceptable values include 'py','xml','json',and 'php' :param kwargs: Arguments conforming to standards found @ https://developer.jwplayer.com/jw-platform/reference/v1/methods/videos/thumbnails/update.html :return: <dict> Dict which represents the JSON response. """

    jwplatform_client = jwplatform.Client(api_key, api_secret)
    logging.info("Updating video thumbnail.")
    try:
        response = jwplatform_client.videos.thumbnails.update(
            video_key=video_key,
            **kwargs)
    except jwplatform.errors.JWPlatformError as e:
        logging.error("Encountered an error updating thumbnail.\n{}".format(e))
        sys.exit(e.message)
    logging.info(response)

    # Construct base url for upload
    upload_url = '{}://{}{}'.format(
        response['link']['protocol'],
        response['link']['address'],
        response['link']['path']
    )

    # Query parameters for the upload
    query_parameters = response['link']['query']
    query_parameters['api_format'] = api_format

    with open(local_video_image_path, 'rb') as f:
        files = {'file': f}
        r = requests.post(upload_url, params=query_parameters, files=files)
        logging.info('uploading file {} to url {}'.format(local_video_image_path, r.url))
        logging.info('upload response: {}'.format(r.text))