Self-trapping of light via the Pancharatnam-Berry phase