When you are loading an imagefrom a Stream, You have to keep the stream open for the lifetime of the image, see this MSDN Image.FromStream.
I think the exception is caused because the memory stream gets closed even before the image gets disposed. You can change your code like this:
byte[] bitmapData = new byte[imageText.Length];
bitmapData = Convert.FromBase64String(imageText);
using (var streamBitmap = new MemoryStream(bitmapData))
{
using (img = Image.FromStream(streamBitmap))
{
img.Save(path);
}
}
Here are some links to threads discussing similar problems:
gdi+ error saving image from webpage
When drawing an image: System.Runtime.InteropServices.ExternalException: A generic error occurred in GDI