To keep the jam from spreading too much, use a thick jam or preserves. You can also chill the filled cookies for 10-15 minutes before baking to help the jam stay in place.