I cheated. My iPhone can take what Apple calls “live” photos — the three seconds before and the three seconds after I press the button are recorded as six-second video. This makes it easy to grab just the right frame (say when several people are moving around, so now I can avoid that awkward moment when the person on the left has her eyes closed), or even keep that six-second slice of time. But also, I can edit the clip to loop (cycle around beginning to end), bounce (go to the end, reverse, go to the beginning, play, etc.), or do long exposure (merging all the frames into one still—this can be very dramatic for the right subject). Then the fun part! I can save the loop or bounce video as a GIF, which Medium treats as just another photo format.
There are online converters that will do this for free, if you have a short video you want to convert to GIF.