Yorkshire captain Andrew Gale scored his first century of the season to lead his side's revival on day three against Nottinghamshire at Scarborough.