Moto Maxx with android 6.0.1 takes random pictures upon on/off button pressing:
Check under Display and disable the highlighted button. This is on Moto X Play and I think you should find it there in your device too