There is no requirement that the homomorphism be surjective....

The whole point of the problem is that: o(h)|n. If this were NOT so, we would have h^{n}≠ e, in which case:

φ(e) = φ(x^{n}) = φ(x)^{n}= h^{n}≠ e, so φ is not a homomorphism (which must map identity to identity).

Homomorphisms are just certain functions between groups, the image of a homomorphism does NOT have to be the entire target group.