added php script to scale an image to be divisible by 256 on both sides, extend the image canvas, determine the zoom level and then call gdal2tiles with the info to create the tiles :)