Fix JPX "Out of Packets" Error (issues 4358, 4659, 4814)

This PR fixes the handling of JPX packets which caused blurriness in JPEG2000 images (#4814, #4659 page 3) and random blocks at the bottom or right border of the images (#4358).

This PR does not fix #5349, so it does not make #5350 obsolete.

The `if` condition in this fix should be equivalent to [jj2000/PktDecoder.java#L483](https://github.com/Unidata/jj2000/blob/185fc9b6ae39ffbe57506b88b6845116efac48b6/src/main/java/jj2000/j2k/codestream/reader/PktDecoder.java#L483)