Using stellar population synthesis models to find photometric redshifts