Impact of grain boundaries on efficiency and stability of organic-inorganic trihalide perovskites