Move releasing logic into camera.js