Gatsby build failing on netlify but works locally [Failed to retrieve metadata from image]

Update:
After searching node modules for that specific error message I found it in gatsby-plugin-sharp and managed to solve it after removing all traces of Gatsby on my local machine and a full clean reinstall of modules/dependencies. It must’ve been some sort of clash in dependencies which led to the vague error message.

Anyway, glad to see that its not a problem with Netlify and hoping this will help someone in the future.