Generative Medical Image Anonymization Based on Latent Code Projection and Optimization