Fit image to grid.