First convert the JPGs into sequentially named GIFs, and then you can use
Code:
convert -adjoin -delay 5 *.gif animation-name.gif
(the convert command is part of imagemagick)
Making a BASH script to do this would be pretty easy if you're going to want to do this multiple times.