Cook , a 21-year-old left-handed opener , scored 104 not out , while Pietersen was more aggressive at the crease and reached 87 before being dismissed by Rahul Dravid .