For JPX decoding only read next packet after checking for byte aligning.

This patch makes the image from #5349 appear correctly, however artefacts
for the last packet seem to still be there.
This patch also optimizes some "in-checks" and adds a few header parsings.
readBits(1) has to stay in, otherwise everything is totally broken. I do not know why. i checked jj2000 as well. I think there is a bug lingering somewhere which the changes I do just circumvent.