Take image when the button is pressed.