I would strongly recommend not using scaled image if you are aiming to get sharp and solid results with a background that is repeated houndreds of time. Here's a nice, 100% programative way to do this using JS and Canvas. Entire JS block as described here takes about half milisecond to execute.
Here's the jsFiddle
var c = document.getElementById("myCanvas");
var ctx = c.getContext("2d");
var w = c.getAttribute('width');
var h = c.getAttribute('height');
var color = c.getAttribute('data-color');
ctx.rect(-1, -1, ++w, ++h);
ctx.lineWidth = 1;
ctx.strokeStyle = color;
ctx.stroke();
var body = document.getElementsByTagName('body')[0];
body.style.backgroundImage = 'url(' + c.toDataURL("image/png") + ')';
And HTML is simply this:
<canvas id="myCanvas" width="20" height="20" data-color="#666666" style="display:none">Your browser does not support the HTML5 canvas tag.</canvas>
All you need to do is echo the width and height that you wan't into this canvas tag (best using server side technology you are usig) and everything will be done automatically.
Let me explain this: ctx.rect(-1, -1, ++w, ++h); We are taking the desired width and height and putting it into variables, then, when painting our rectangle we want it's width to start at [-1, -1] coords, so that we don't have left and top border painted (we don't need it if we want our pattern to tile niecely), and ++w and ++h is just incrementing the painted rectangle width and height by one pixel to go beyond the boundry of canvas and thus strip those two unnecesarry borders.
Try changing width and height in the `canvas`` tag in the fiddle I've made and see if you like the output.
Going this way you can also have control over the width of the line as well as it's color.