If the DIVs don't need IDs then you could just add the same class-name to each for styling. Otherwise you could number them sequentially:
$i = 0;
echo '<div id="thumbnail"' . $i .
$i += 1;
Try clearing your browser's cache; and use the browser's Console - generally, right-click and Inspect Element - to see if the background image is there, but just not displaying for some reason.