Throttling resize function. Fixes #47