Update demo to avoid globals

Since we can get the original image from event.target, we don't need to
store it in a variable ahead of time.