js function to change picture changed