add padded image function