Steps to replicate the issue (include links if applicable):
In MediaWiki 1.40 or later, go to Special:Upload and select an image to upload. Look at the preview of the selected image.
What happens?:
When uploading an image using Special:Upload, after choosing the file to upload, a preview of the image appears on the upload form. This image is intended to float on the right side of the screen, in a frame like would be used when displayed in an article.
However, instead the image is just placed on the left at the top of the "Source file" form.
Screenshot from Bulbagarden Archives (Bulbapedia)
Screenshot from Zelda Wiki
What should have happened instead?:
This image should float on the right side of the screen, in a frame like would be used when displayed in an article.
Screenshot from English Wikipedia
Software version (on Special:Version page; skip for WMF-hosted wikis like Wikipedia):
Observed in 1.41.4 (Zelda Wiki) and 1.43.0 (Bulbagarden Archives), but it should occur for all versions from 1.40 onward, based on my understanding of why this occurs that is explained below.
Other information (browser name/version, screenshots, etc.):
This appears to be because this display depends on the deprecated CSS classes thumb and tright. You can enable these deprecated classes by setting $wgUseLegacyMediaStyles to true, but that variable is set to false by default. Since MediaWiki 1.40, due to $wgParserEnableLegacyMediaDOM being set to false by default, this means those deprecated CSS classes will not work unless one of those two settings is changed.
As a result, this means that without specifically enabling legacy behaviour, from MediaWiki 1.40 onward, the default upload form will display incorrectly.


