I always heard if using a 2 conductor cable for a switch the white should be the hot one, so when(or is it IF?) is tested it'd show hot all the times. Don't think it's really an NEC thingie. I don't see anything wrong, as far as that is concerned, as long as the white wire is reidentified with a black(or red) tape. Personally I would prefer it that way.
However....
The panel has 8 breakers, no main, and a bunch of grounds connected to the neutral bar. If it's a services panel and the neutral is bonded to the ground, then it's a violation of the 6 main rule. If it's not, than the ground wires can not be terminated on the neutral bar.
The feeder seem to be an SE cable(most likely 2 hots and a neutral) so not sure how getting the ground wires properly connected can be accomplished.
Also, seem the switch box doesn't have a connector(could be wrong)