Image Clustering and Classification Using Optimization Algorithms