Preventing duplicate images