Chart image is broken when the chart is being resized