updated scripts writing to png