Updated texture manager : finalization and error handling