Improved capture code to manually set exposure