Intense ion beam optimization and characterization with infrared imaging