Bipolar space charge formation and switching effect in thin polymer films