Some (style and code) fixes to math library
Cleanup in Image.hpp
Correctly catch exceptions for better debug output