Transferring and learning representations for image generation and translation