Effects of divalent cation impurities on surface space charge in thin AgBr films