Preheat oven to 375 degrees. Line a large cookie sheet with parchment paper and spray with cooking spray or brush lightly with vegetable oil. Lay 1 sheet filo on paper and brush lightly with a little melted butter. Sprinkle all over with 1 tablespoon parmesan. Repeat layering 5 more times, pressing each sheet firly so it sticks to sheet below. Lay the last filo sheet on top, brush with remaining melted butter, and sprinkle on remaining 2 tablespoons parmesan.
Scatter onion across filo, top with mozzarella, and arrange tomato slices in a single layer, overlapping slightly. Sprinkle with thyme or oregano, and salt and pepper.
Bake until filo is golden brown, 30 to 35 minutes. Cool 10 minutes, then serve. About 20 3-inch squares.