High-resolution scanning optical microscopy of ferroelectric thin films