Remove gif, if an exception is thrown