An AI tool for the petroleum industry based on image analysis and hierarchical clustering