It may be possible that he had not expected you to walk in on him (he could have done it in the shower while you're at home and not know about it) What you feel may be all tied to the fact that he had been doing this while looking at a picture of another woman.
Many men do engage in self stimulation (especially those who have high level of testosterone and hence high libido level) The simple act of self stimulation does not mean that he does not love you. He may have just not though about how upsetting this would be to you. Also, the past trauma you're dealing with, is not something that his act should have evoked the feelings. It may be related to your initial shock and then all sorts of other feelings were triggered possibly even self esteem issues.
Do the two of you watch adult movies, etc.?