fixing the canvas image problem