This is related to another error How to resolve this problem: Failed to parse (PNG conversion failed; check for correct installation of latex, dvips, gs, and convert) in MediaWiki when I try to enable math?
First, make sure you have two folders, each with permission 777:images/math and /images/tmp
If they do exist and have the correct permission, then check if any png file is generated under /images/math, if not, see the above problem for another error. Or, it is because of the two variables that are incorrectly set in LocalSettings.php. ---> for me this is the problem.
Look at the following vars:
$wgUploadPath = "";
$wgUploadDirectory = "";
The first one will be used for accesing the png online, in my case, my site uses redirection, so the images are not located, hence I used the absolute path for the first one, e.g., $wgUploadPath = "http://wujiewen.com/wikinotes/images". If you are to use a local path, be sure to include a slash before the folder name! e.g., /image
The second one however does not need the slash before it!