Fixed PHP errors and update JS to disable 'Next' until image selected.