Adding or removing a PreImage using RegisterPluginStep.AddImage(ImageType.PreImage) does not trigger an update of the plugin registration, which results in a NullReferenceException if using the PreImage entity.
Although not tested, the same is most likely the case for PostImage.