public void changePicture() throws InterruptedException{
        //Get Image Name
        path = getImageName();
        
        //If image exists try to change the image
        if(path!=null&&!path.equals("")){
            try{
                //Read in the new file
                profileImage = ImageIO.read(new File(path));
                //Paint the new image
                repaint();

            }catch(IOException e){
                //If the new image causes problems, set the image to default
                path = defaultPath;
                try{
                    profileImage = ImageIO.read(new File(path));
                    repaint();
                }catch(Exception ex){
                    System.out.println("A problem occurred. "
                            + "Your profile picture can not be set ");
                }
            }
            finally{
                /*
                 * Initalize maxThreads to the number of cores
                 * This is used to run the ImageUploader as a asyncronous thread
                 * on multicore machines. Otherwise, the program freezes until the
                 * upload is completed on single core machines
                 */
                int maxThreads = Runtime.getRuntime().availableProcessors();
                
                //If the machine is multicore, run the ImageUploader as a seperate thread
                if(maxThreads>1){ 
                    
                    /*
                     * Initilize the executor service and add the ImageUploader as a single thread
                     */
                    ExecutorService tpool = Executors.newFixedThreadPool(maxThreads);
                    ImageUploader iu = new ImageUploader();
                    iu.setUsername(username);
                    iu.setImagePath(path);
                    //iu.setDebug(true);
                    
                    //Run the image uploader asyncronously
                    tpool.execute(iu);
                    
                }else{
                    /*
                     * Alert the user that they only have 1 core
                     * single core machines freezes until the upload is completed
                     * 
                     */
                    JOptionPane.showInternalMessageDialog(this.getParent().getParent(),
                        "You have only a single core processor.\r\n"
                            + "Your window might become unresponsive\r\n"
                            + "while the image is being uploaded...",
                        "Caution", JOptionPane.INFORMATION_MESSAGE);
                    if(profileImage!=null){
                        //Upload the image in the same thread
                        //This freezes the program until upload is completed
                        ImageUploader iu = new ImageUploader();
                        iu.setUsername(username);
                        iu.setImagePath(path);
                        iu.uploadImage();
                    }
                }
            }
        }
    }