<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(client, source_dir):
 """ Upload images to play store. The function will iterate through source_dir and upload all matching image_types found in folder herachy. """

    print('')
    print('upload images')
    print('-------------')
    base_image_folders = [
        os.path.join(source_dir, 'images', x) for x in image_types]

    for type_folder in base_image_folders:
        if os.path.exists(type_folder):
            image_type = os.path.basename(type_folder)
            langfolders = filter(os.path.isdir, list_dir_abspath(type_folder))
            for language_dir in langfolders:
                language = os.path.basename(language_dir)
                delete_and_upload_images(
                    client, image_type, language, type_folder)