Add input control to prevent errors in Fiji when using a stack with the wrong number of slices and frames.
Remove listeners when closing GUI.