A police officer who assaulted a vulnerable young girl while on duty and superimposed his face onto child abuse images has been jailed for nine years.