Google has to index your content before it can properly rank your site. This means the search engines need to be able to crawl your site and see all your pages and media.
For this reason, Google isn’t necessarily a big fan of hidden images or hidden content. In fact, hidden content is often associated with spam websites and black hat SEO scams.
However, for genuine use cases like this one, you should be able to hide Pinterest images without it negatively impacting your Google ranking.