Why not try fetching the image dimensions and then setting the height and width of the container div equal to 100 times of height and width of the image (respectively) and then just use CSS background-repeat property to repeat the image on x and y axis. This solution might work as you are trying to repeat a single image.
See it in action: http://jsfiddle.net/vzX9q
The HTML:
The Javascript:
$(document).ready(function() {
var imgSrc = "http://lorempixel.com/100/100";
$("#img").css({
background: "url("+imgSrc+") repeat"
});
var newImg = new Image();
newImg.src = imgSrc;
newImg.onload = function() {
var imgHeight = newImg.height;
var imgWidth = newImg.width;
$("#img").css({
width : imgWidth*100,
height: imgHeight*100
});
}
});