added the slice method into the timer and created a setReferenceImage Button and function