Calculate available size
Find best thumb size