Refactored stillImageCapture method