It's not easy to make it work with floats, and I couldn't come up with a satisfactory solution. However I did find a similar solution with inline blocks that ends up looking exactly the same. Key points:
a) change float: left;
to display: inline-block;
inside .mosaic li {}
b) make sure there is no whitespace between <li>
elements (otherwise there will be horizontal gaps).
c) add line-height: 0;
to .mosaic {}
(otherwise there will be vertical gaps).
Resulting js-fiddle: http://jsfiddle.net/RN4pj/2/