image padding script, initial version