finished imagestack.java and added the undo and redo variables