added messageBox for error handling and started setting up inmage saving functions