Fix get_thumbnail function