Unfortunately we don't know the appropriate thumbnail size in advance but enforce some sort of maximumAccording to specification `sizes` is a space-separated list of sizes which are separated by `x` or `X`.
Also, try to find a thumbnail closest to 512x512 to avoid loading huge thumbnails.