retry on duplicate exceptions when saving gallery images