added img.onload to slicer.js