David Gilbert finished the third session with a brilliant century against Kyren Wilson at the World Snooker Championship.