Nonisoplanatic imaging by phase diversity