This question is related to this older one: Isotope Grid layout use empty space
Here is the fiddle I am working with: http://jsfiddle.net/zewkG/4/
The issue is
See http://jsfiddle.net/zewkG/6/, I hope I understood well what you want
Edit:
If you want 21 boxes, see http://jsfiddle.net/zewkG/8/
Edit 2:
http://jsfiddle.net/zewkG/8/ has a bug: boxes number 13,17,21 (at the end of the row), when clicked, they go to the following row instead to the beginning of its row. Fixed in http://jsfiddle.net/zewkG/9/