File.retain() specifies type instead of returning raw ID
Correctly restore complex retained files.