added parameter for rotating image by 180 degrees