fix resizing of caption when grid is re-rendered