Random GIF on hover

Hi! I’m trying to show a random GIF everytime someone hovers over something.

At the moment I already have everything setup that once it hovers, it shows an image.
I’m wondering if it is possible instead of showing the image to show a random GIF? And if that’s possible to get the GIF directly of GIPHY?

Thank you!