Parse image width/height and set canvas size