added local image loading and canvas resizing