Masturbation is always wrong, as true conjugal love is necessarily other-centered, not inwardly focused in a selfish way, which is characteristic of lust (CCC 2351-52). So masturbation is wrong, whether one thinks of his real wife, his fiancée, or his “hypothetical wife.” In each case, a person would be making a woman into an object of selfish satisfaction, not valuing her as a whole person. And that would be the case even if a man doesn’t complete the act. The immorality of masturbation is not contingent on whether one sexually completes the act.
In contrast, there’s nothing wrong with a husband’s anticipating being conjugally intimate with his wife later in the day, provided there is no masturbation or lustful thoughts otherwise (see Matt. 5:27-28). In addition, there’s nothing inherently wrong with being attracted to a woman. One can recognize a woman’s beauty without lusting after her. However, if the woman is not your wife or fiancée, don’t dwell on that attraction. It’s a moral dead end. For more on this subject, see this related answer.