Fix memory leak with new animated gif frame cache