getImage is returning undefined so my GatsbyImage component is not rendered. File structure: src/pages/gallery.js src/images (has 12 photos named photo-01.jpg, photo-02.jpg, …) I have the following code (gallery.js): what can i have wrong? Answer The problem is that you are mixing gatsby-image (from Gatsby 1 to Gatsby 2) and gatsby-plugin-image (from Gatsby 3 onwards). The first one is now deprecated.