[PATCH 17/26 v6] spl: Extract legacy image handling into separate file