Solving TakePicture and TakeRawPicture issues