Dissolve raspberry or cherry gelatin in 1 cup boiling water.
Stir in the cherry pie filling. Pour into a 10-inch deep-dish pie plate. Chill until thickened partially. Dissolve lemon gelatin in 1 cup boiling water. Beat the cream cheese and mayonnaise together and stir in the unchilled lemon gelatin mixture to this. Blend in the undrained pineapple.
Whip 1/2 cup whipping cream until soft peaks form. Fold into lemon mixture and add the marshmallows if desired. Spread this mixture on top of the cherry pie mixture that has been chilling. Sprinkle the chopped nuts over top and let chill until completely set.