functions generatePic and generateAll convert array index to pictures on the html page