Blocking animated gifs in Safari
If you are willing to install and use a local filtering proxy:

The venerable Privoxy will allow you to deanimate GIFs.

While a fine grained setup can be quite involved, that deanimated GIF-thing is quite easy to configure with the preset "medium" already. (Or via one radio button in the settings page.)

Playing those GIFs in a website you do want to see is then quite a hassle, though. That would require a trip to System Preferences, change proxy settings and then reloading the page. Depending on how often you need that feature, it's easiest to use another browser for that that does not get filtered.

As two examples: Firefox comes to mind, since it has proxy settings differing from the system preferences, or OmniWeb, which ignores the system settings.