bugfix: correctly handle very thin images