Soliton formation in square photonic lattice through combined effects of total internal and Bragg reflections