Refactor tests to be async for ease of testing
Return a promise in resizePageImage() instead of callback style