Fix for 'A generic error occurred in GDI+'