Update & adapt to latest libgd