Using a polyimide foam stabilizer to improve the surface finish of the foam