animations for sprites

Hola! I’m writing a maze game where there are some animated sprites.
Is better to

  • build an animated gif image and load it

or

  • a class like animation with a method to build an arrayList of frames where each frame displays for a certain amount of time a png image of the sprite, an update and getImage methods?

I prefer an Animation class in connection with some kind of animation strategy. You can spare a lot of
work with using the same animation-sequence with different strategies, e.g. looped, backwards, indexed
etc.