fix bug in get_unique_medium_name