This node app takes in the images(jpg/png) that you feed it and passes it to ffmpeg.

It uses multipass method outlined here and here. Resized (if needed) to 800px aspect maintained gif