Well, you're not thinking about those things when you're having actual sex, either... atleast I hope not.
I'm sure some people masturbate and think about someone other than their partner, but there are people that have sex with their partner while thinking of someone else too. One is worse than the other, tho. If you're with your partner, you should be focused on that... when you're alone... think about whatever you want. The showerhead ain't gonna tell.
I've read in a medical article that orgasms while on your period can help ease cramps and aid the flushing out of the uterine lining, and there aren't many women who want to have sex during that week, so masturbation seems like the better treatment.
But it's just like anything else, in moderation it's healthy, to excess, get a wrist brace and stop watching porn.
EL