Change grid.js and handle different kind of grid items (<div>, <img> etc.)