Phase sensitivity in imaging and scatterometry