Modify custom ota_from_target_files

taken from http://review.cyanogenmod.org/#/c/33585/