How to create animation/gif with 4 photos?

I have 4 photos, I want it to make custom animation with this 4 photos, with this options:

  1. Choose how many miliseconds every photo will be
  2. Choose which effect will be in every photo change (fade or none)

How should I make it with Angular 2?
I don’t want to use ngShow on 1 picture and ngHide on the other 3 because it can be buggy.

Please help me.