The effect of imperfectly insulated sidewalls on natural convection in porous media