Thermally-induced chemical transformations and self-assembly of short peptides on metal surfaces