collapse node style and cleaning up style when image not set