Swelling-induced eversion and flattening in naturally curved gel beams