code for taking and sending photos implemented