A California man who posted thousands of sexually explicit photos of men and women on a revenge porn website was jailed for 18 years in what was described as the first case of its kind in US criminal history.