Preheat the oven to 160ºC fan.
Spray a large frying pan with low calorie cooking spray and place on a medium heat. Add the onions and leeks and fry for 15 - 20 minutes, adding the garlic for the last 5 minutes. The onions and leeks should be softened and golden brown.
While your onions and leeks are cooking, boil the potatoes for 15 - 20 minutes or until tender. Drain well and mash with the milk.
Add the onions, leeks and garlic to the pan of mashed potato. Also add the thyme, the 2 medium beaten eggs and 60g of the Cheddar cheese. Stir well and season well to taste.
Grease a round, loose bottomed 23cm cake tin with a little reduced fat spread (your tin should be quite shallow).
Place a single sheet of filo pastry in the bottom of the greased tin, and allow the excess pastry to overlap the top edge of the tin. Brush the pastry all over with some of the small, beaten egg for glazing.
Place another single sheet of filo pastry on top of the first sheet, at an angle. Again, allow the excess pastry to overlap the top edge of the tin and brush with egg for glazing.
Repeat this process until all of the filo pastry has been used to line the tin. Brush egg all over the final layer of pastry.
Spoon your potato mixture into the prepared pastry case and spread out evenly. Sprinkle the remaining cheese on the top and place on a baking tray.
Place in the preheated oven for 30 - 35 minutes until hot right through and golden brown.
Allow to cool slightly in the tin, then carefully remove and place on a serving plate. Serve warm.