Thousands pay last respects to pope