A Preston man has been jailed for sexually assaulting a child and taking indecent photographs.