when you upload a file, what is in imageType? try to use an Application variable or static variable to keep a mapping between the ContentType and System.Drawing.Imaging.ImageFormat, for examplestatic Hashtable ht= new Hashtable();...
ht["image/jpeg"] = System.Drawing.Imaging.ImageFormat.Jpeg;
ht["image/gif"] = System.Drawing.Imaging.ImageFormat.Gif;
....then when you unload a file, you just do
(System.Drawing.Imaging.ImageFormat)ht[YourImageContentType]