This was an issue I raised some time ago.
http://forum.drdteam.org/viewtopic.php? ... 23&p=23856
I have noticed a lot of mods using black as transparency and forgetting about what it would look like in an inverted palette mode. However, in many cases the fix is reasonably simple from a modding POV: instead of using black, use transparency in your sprites.
Unless you use properly translucent sprites too, you will never clean it up perfectly. Ultimately, the invulnerability palette inverts the colours. So, black becomes white (ie, the main problem) but dark colours become light. So, you can't prevent those dark colours becoming light and you have to accept that things will look odd in invulnerability mode but you can fix the worst problem of a big white square around your sprite.
Another fix (or work around) would be to use a non-inverted palette on a custom invulnerability powerup - eg the goldmap from Heretic. However, this will not fix the issue for people who use the enhanced night vision mode in GZdoom because it also uses an inverted palette so I suggest both fixing the sprites and making a custom powerup.