I never used an M8 but this often happens if the display show the number of images possible to store and you have large card in combination with shooting jpeg.
Basically, the display does not go higher than 999. If you keep shooting images, it will eventually start to show lower values. Not sure about the 666 though (unless your camera was upside down)....
The devil has possessed your camera only when it reads 666. I've seen the 999 on mine when I had it but never 666. I don't have an answer really on that