Usually there is also a pin 1 marker on the connector. This is an arrow symbol on the side of the connector where the bump is.
When you look at the connector with the plastic bump facing you and the pin openings down, the arrow should be on the left. The outermost wire is connected to pin 1, then next one to pin 2, etc.
Looking at your picture that would make the grey lead connected to pin 1, the white lead to pin 2, .. and the green lead to pin 8.