Getting a general error when using GDI+

I am getting a general error when using GDI+.
I get the error when I save an image on GDI+. "A generic error occurred in GDI+." Here is the screenshot of the code I used to resize the image upon uploading it to the site.
I may have missed a thing I am not familiar with. Any help will do.
