made attachment JS use new_mid to fix issue of ephemeral IDs crashing on preview