Implemented a more proper click handling and fixed image scaling