j2k/jpeg2000: merge lowres code