capture photo, handle callbacks functions