I have already red some answers here on stackoverflow regarding this, but i just can't figure out which part am i disposing too fast:
A generic error occurred in GDI+, JPEG Image to MemoryStream
Image.Save(..) throws a GDI+ exception because the memory stream is closed
The exception is thrown on this line:
image.Save(path, imageCodecInfo, encoderParameters);