Surrounded jpeg 2000 decompression with try catch.
Reordered code.