Dielectric Metasurfaces for Integrated Imaging Devices and Active Optical Elements