If there's a 0px by 0px image in the MediaSearch results (any tab except audio), then MediaSearch breaks
Examples:
https://commons.wikimedia.org/w/index.php?search=30bytes&title=Special:MediaSearch&go=Go&type=image
(the file 30bytes.gif is a 0px by 0px image)
It's fine if you're searching for audio files:
https://commons.wikimedia.org/w/index.php?search=Haunu&title=Special:MediaSearch&go=Go&type=audio
Note that there are 12 out of 73267622 images on commons currently that are 0px in width, so this might not be very urgent
I'd guess the problem is ImageHandler::validateThumbParams() which fails if an image's width is zero