apply a padding to images