imagemagick: limit the number of frames