LPS-42485 formatImage throws NullPointerException