camera: bugfixes and cleanup

Change-Id: I71aaef350e3617b024ec036c146de34598d2b35f