Reflow thumbnail code