Viewer: pass the mipmap level in getImageRectangleDisplayed function to
avoid confusion.
This also fixes a small bug.