Fix image freeing after failure to load a cubemap.