Reduce memory consumption of PANDROID image converter script