added new images, tweaked condition code logic, safeguards against bad data