fix grid of image details javascript