changes to thumbnail generation, random layout improvements