Implemented the toggling of the image between play and pause