reader.setInput(iis);
LinkedList<Frame> frames = new LinkedList<Frame>();
for(int i =0;true;i++){
try {
BufferedImage bi = reader.read(i);
frames.add(new Frame(bi,alignment));
} catch (IndexOutOfBoundsException e){
break;
} catch (IOException e) {
e.printStackTrace();
}