Tidied up imports
Merging changes from github with local changes
Cleaned up imports
Image tempfiles are now automatically deleted when they are no longer needed, or when the program closes.