Pedrosa pipped to front row position