fixed image serialization