Yes, use a lanyard.
This is what I do.
1st make sure you are completely comfortable with all the emergency drills and can literally do them with your eyes shut and without thinking. If not, practice until it becomes 2nd nature.
Then try taking the camera down but not using it. See where the best place to clip it off is that doesn't interfere with any of your drills.
I then started to use the camera during the bottom time taking extra care to note depth and time and then would clip the camera off for the ascent / deco schedule. As i became more comfortable, i would then start taking some photo's to while away the time on the final stop.
The diving comes 1st, if necessary ditch the camera.
The lanyard i use has a clip in the middle so it is fairly short and will clip off nicely, When using it i undo the clip and it has an curly bit that makes it about 4 times longer. I can then let go of the camera and as it is slighty negative it hangs below my knees and is clear of the stages. I now have 2 hands to perform whatever drill i need, be it gas switch, loop clearing etc.
Also remember that you are going to feel alot more narcosis while you are task loaded taking photos so adjust your depth or mix accordingly.
Have a buddy who is not taking photos so he can slap you when your discipline starts to slip.