fix fitting image into given box. fixes #33