The script for the effect of the pictures, I run perfectly out of the grid but when placed within the grid is not running, this happens to me for the Firefox browser.
Most probably your script process page on document loading, fetching @thickbox elements. But in case of grid - data will be loaded on the page a bit later than onload event ( because data loading is async ) , so elements can appear after your script already finished page processing.