Sensor pattern noise (SPN) has been extensively studied in the scientific community and has found its applications in many practical scenarios in the law-enforcement sector. However, the emergence of photosharing social networking sites (SNSs) poses new challenges to SPN-based digital image provenance analysis. One particular issue is that the SNSs' built-in image editing tools tend to inflict distortion on SPNs. One well-known example of such tools is the image filters on Instagram. We observed that some Instagram image filters manipulate the high-frequency bands of the images and hence damage the SPNs, making source-oriented clustering (SOC) of the filtered images unsatisfactory. To address this issue, we propose to first separate the images processed by different filters beforehand into two groups, with Group Malignant (M) containing the filters that significantly distort SPNs and Group Benign (B) covering the other filters that have no significant impact on SPNs. We then cluster the images processed by Group B filters and calculate the centroid of each cluster, with one centroid representing the reference SPN of the corresponding camera. Finally, we use the centroid of each cluster to attract the images processed by the Group M filters in order to complete the SOC task. To identify the filter applied to each image so as to facilitate the clustering, a convolutional neural network based filter-oriented image classifier is proposed. Tested on 19,332 images processed by 18 different filters, the classifier delivers a very promising accuracy of 98.5%. Moreover, compared to the F1-measure of 47.74% by directly clustering on 1,800 filtered images, our proposed clustering framework achieves a much higher F1-measure of 90.33%. INDEX TERMS sensor pattern noise, image clustering, social network, digital forensics, provenance analysis.