migrateImagesToSwift: handle read-only wikis

Port #1949 to the upcoming release