Sometimes apps running in background eats up the processor and hence it causes lagging and freezing while taking pictures. Make sure to close the apps and then retry the camera app.