Added on-demand resizing of canvas images.