Fixes #2. Extracted the resize sensor stuff to own class.