Moved setting the stackFile fileName as soon as the stack is created to allow relative image paths to resolve correctly