Handle stride when dumping images.  Fix #18 and #30.

Signed-off-by: Rüdiger Sonderfeld <ruediger@c-plusplus.de>