Preheat the oven to 400°F
Melt the butter in a large skillet. Add the leeks and sauté for 4 minutes. Add the garlic, thyme, cream, salt and pepper and bring to a simmer. Simmer for 20 minutes.
Spray a baking dish with cooking spray. Line the bottom with potato slices, top with leek-cream mixture, then parmesan, repeating the layers until you fill the dish.
Bake until bubbling on top, about 30 minutes.