It's really a toss up. He probably meant for it to be flattering, and if you can take it that way, more power to you. I'd probably be pretty flattered to find out that someone thought about me while masturbating, but it is also completely understandable to be a little weirder out over it. You have no idea what he's doing to you in his head, and it is a little base to think that you're little more than a sexual fantasy. There are other times where I would prefer to have a girl think about me, if I have my choice, besides masturbation. So you take it however you want to, and if it bothers you it isn't immature in the slightest. If you take it as a compliment, that's fine because he meant it that way. Just make sure to let him know if you are insulted or bothered by it, so that he can think of some other way to compliment you in the future.
-------
Sic Semper Moderators