'Download and validate image URL.'

def perform_create(self, serializer):

    imgs = []
    for (image_field, hash_field, suffix) in self.image_fields:
        if serializer.validated_data.get(image_field):
            img_url = serializer.validated_data[image_field]
            (img, hash_) = image_from_url(img_url)
            imgs.append((suffix, img, hash_))
            serializer.validated_data[hash_field] = hash_
        elif ((serializer.validated_data.get('type') or (serializer.instance and getattr(serializer.instance, 'type', None))) == feed.COLLECTION_PROMO):
            serializer.validated_data[hash_field] = None
        if (image_field in serializer.validated_data):
            del serializer.validated_data[image_field]
    obj = serializer.save()
    for (suffix, image, hash_) in imgs:
        if image:
            i = Image.open(image)
            path = obj.image_path(suffix)
            with public_storage.open(path, 'wb') as f:
                i.save(f, 'png')
            pngcrush_image.delay(path, set_modified_on=[obj])
