Try to fix memory leak with discarding animated images