Roll out the pastry on a lightly floured surface and use to line a greased 28 x 18 cm (11 x 7 inch) shallow baking tin. Line the pastry case with baking parchment and baking beans (or dried beans reserved for the purpose). Bake in a preheated oven, 200°C (400°F), Gas Mark 4, for 15 minutes. Remove the paper and beans and bake for a further 5 minutes. Reduce the oven temperature to 180°C (35°F), Gas Mark 4.
Spread the base of the pastry with the jam. Beat together the butter, caster sugar, eggs, flour, baking powder and almond extract in a bowl until smooth and creamy. Beat in the ground almonds. Spoon the mixture over the jam and spread gently in an even layer.
Scatter with the flaked almonds and bake in the oven for about 40 minutes until risen and just firm to the touch. Leave to cool in the tin.
Beat the icing sugar with a dash of water in a bowl to give the consistency of thin cream. Spread in a thin layer over the cake. Allow to set, then cut into squares or fingers.