Image tiling with Ruby