added image resize function

Signed-off-by: Wouter Vroege <wouter@woutervroege.nl>