working migrate-images script