Fixed homepage image rotation and tidied up code