Interrelation between orbital polarization and magnetic structure in bilayer manganites