delete image when rows is gone from database

def photo_post_delete_handler(sender, **kwargs):
    '''delete image when rows is gone from database'''
    instance = kwargs.get('instance')
    instance.master.delete(save=False)
    instance.delete_all_renditions()