wrote a function to find the best thumbnail to use for a given size