Gateway courses are designed as 'widening participation' entry for those from low-performing schools, low socio-economic postcodes etc who also have predicted grades that are not high enough for immediate entry to a 4 year course.
They are NOT the same as a Foundation course. These courses are usually for those who have not taken the right subjects, or have low achieved grades, mature students, international students etc - whatever that Uni decides are the entry criteria.
In terms of retakes - IF you meet the criteria for the Leeds GW course, and this is 'school attended', you need to ensure you do those retakes at the same school. If you switch to a school/college that doesnt qualify, you wont be eligible. Check with the Uni to make sure about your circumstances - do not just assume you are eligible.