changed calculation of x position in grid view to avoid position jitter
improved image scaling in grid demo