Error message bug in image.php
File name not being shown in error messages.
I was having a problem loading images because I had not enabled GD2 in my php.ini file.
While looking into this within image.php I noticed that the variable defined as $filename should be $file_name. This was preventing the filename being shown in the error messages.
Also, as in my case, if the image functions are not available the code drops into the sanity check, declaring unknown image type rather than missing functions.