added in a check to exit if all images aren't the same type