Query embedded asset in Rich Text for generated page temnplate

How do I create a

which queries RichText.raw (parsed to json and rendered to html) and use body.references for embbeded assets in . I have the following, which works until I try to include the block for the embedded asset (the last section).

{documentToReactComponents(JSON.parse(post.body.raw), {
                        renderNode: {
                            [BLOCKS.PARAGRAPH]: (node, children) => 
                            (<p>{children}</p>),
                            [BLOCKS.HEADING_2]: (node, children) => (
                                <h2>{children}</h2>),
                            [BLOCKS.HEADING_3]: (node, children) => (
                                <h3>{children}</h3>),
                            [BLOCKS.QUOTE]: (node, children) => (
                                <blockquote>{children}</blockquote>),
                            [BLOCKS.EMBEDDED_ASSET]: (node, children) => (
                              const imageData = richTextImages[node.data.target.sys.id];
                              const image = getImage(imageData.image)
                              return (
                                <GatsbyImage image={image} alt={imageData.alt}/>);
                            ),
                            },
  
                    },)}