ImageOutputStream otStream = null;
List<RenderedImage> images = new ArrayList<RenderedImage>();
try {
otStream = ImageIO.createImageOutputStream(outStream);
gifWriter.setOutput(otStream);
gifWriter.prepareWriteSequence(null);
// gif params
final GetMapRequest request = (GetMapRequest) mapContent.getRequest();
final Boolean loopContinuosly = (request.getFormatOptions().get("gif_loop_continuosly") != null ?
Boolean.valueOf((String)request.getFormatOptions().get("gif_loop_continuosly")) : wms.getLoopContinuously());