Added a condition on the mobile device calculation to exclude the hidden canvas
Added an extra style attribute to make sure the canvas is 500x500