Fix crashes when resizing sub images

Image rectangles were not read correctly resulting in invalid buffers
Fixes #1
Fix invalid rollback in asm vertical routines

Rollback was not set correctly, corrupting output
Fixes #2