added padWith function

I needed to control precisely how my image was padded (to center a particular part of the image),
so I added this "padWith" function, that looks like "trim"
I'm not sure about the name, but "pad" was taken.
I also added a simple test.
The "padTo" function has be also modified to use "padWith".