Refactor ImageFilterWriter into ImageCMWriter