Preheat the oven to 200C/180C Fan/Gas 6.
Lightly flour a work surface and unroll the puff pastry flat. Using a ruler and a pizza wheel, cut into 72 small, equally sized squares. Transfer the squares to 4 baking trays and brush each square with a little of the beaten egg, especially at the edges.
For the pesto bites, using a teaspoon, place a little pesto in the centre of each of 36 squares. Top with a quarter of a mozzarella ball and a quarter of a tomato. Season with salt and pepper.
For the prosciutto pizza bites, place the onions in a bowl and salt generously. (Salting the onions draws out their sharpness and begins to soften them.) Using a teaspoon, place a little sour cream in the centre of each of the remaining squares. Rinse the onions under running water. Drain well. Place a few slices of onion on each square. Divide the prosciutto between the squares, ensuring that a little fat gets on each piece.
Bake both types of pizza for 15 minutes, or until the pastry is puffed and golden-brown.
The tomato ones can be topped with a basil leaf if you want, and are best served hot. You can serve the white pizzas hot or cold.