Dewetting-mediated pattern formation in nanoparticle assemblies