Trying to build a simple image zoom in/zoom out functionality which supports different modes of zooming like through a button, mouse wheel, pinch and zoom etc. surprisingly difficult to handle the various scenarios.