Outsourced img2avi.sh