Add avatar and placeholder JavaScripts

Fix for #592, please verify @monreal and @mroi