Suggested by @Krinkle in https://gerrit.wikimedia.org/r/c/mediawiki/extensions/MultimediaViewer/+/1281949
Perhaps a long-term fix would be to improve imageinfo API to always return a set of thumbnail URLs (and deprecate iiwidth param) so that MediaViewer simply calls that (as it already does) and get the URLs for free instead of the current situation where it needs to call imageinfo API twice (once for metadata, once for thumb URL) where the second one is replaced with a "guesser" in prod, we'd no longer need the second step.
Also relates to comment by @TheDJ in https://gerrit.wikimedia.org/r/c/mediawiki/extensions/MultimediaViewer/+/1254995
I'm also confused as to why we are guessing urls to begin with ?
There already is a blocking call to the apiinfo.. might as well calculate the needed dimensions first, then ask the api for the url for those dimensions in the same call as where we retrieve the other information.
Currently, iiurlwidth defaults to -1 and is defined as
If iiprop=url is set, a URL to an image scaled to this width will be returned.
Maybe iiurlwidth=* should return all thumbnail URLs specified by wgThumbSteps?