Fix string encoding in get_thumbnail