Refactor some code on admin_cloud_image tests