Apparently JIT 2 chokes on square images in Mode 4 if the output is square too:
If the source image is 800×800px:
…/image/4/400/400/img/bilder/filename.jpg.jpg
this render the invalid dimensions error, whereas
…/image/4/400/401/img/bilder/filename.jpg
works as expected.

Using the first recipe with non-square images works fine. Also all the other modes with the square.