added rotation on the image in the html file, added a lot of debug stuff since no comment exists in the js