Moved camera shutter control to inside the MotionEndedTask handler