Manual:$wgMaxImageArea

Details
Don't thumbnail an image if it will use too much working memory.

Default is 50 MB if decompressed to RGBA form, which corresponds to 12.5 million pixels or 3500x3500.