fixed serialization for ImageType