Optically controlled imaging phase mask element