public static ArrayList<String> createTagPool(Map imagesTags) {

        if (PRINT == 1)
            System.out.println("Creating tagpool...\n");

        ArrayList<String> tagpool = new ArrayList<String>();

        /* Iterate through the map */
        Iterator itMap = imagesTags.entrySet().iterator();

        while (itMap.hasNext()) {
            Map.Entry pairFromMap = (Map.Entry) itMap.next();

             /* Select the list of tags in the pair (ArrayList) */
            ArrayList tagList = (ArrayList) pairFromMap.getValue();

            /* Iterate through that list and add tags */
            for (String s : (ArrayList<String>) tagList) {
                /* If it doesn't already include the tag... */
                if (!(tagpool.contains(s))) {
                    tagpool.add(s);
                }
            }
        }

        if (PRINT == 1)
            System.out.println("Created tagpool.\n");

        return tagpool;
    }