Loading the images and setting up the WebSocket connection