If a texture cannot be overwritten, the exception is caught

Proper cleanup is also done now (i.e. old files are deleted)