Manual:$wgThumbnailMinimumBucketDistance

Details
This variable influences how intermediate thumbnails are used when   is enabled: an intermediate will only be selected as the source for creating the target thumbnail if it is at least   pixels wider.

For example, with the following buckets:

and a distance of 50:

if we want to render a thumbnail of width 220px, the 512px bucket will be used, because 220 + 50 = 270 and the closest bucket bigger than 270px is 512.