W3schools Javascript Reduce Image