Move port to config, whitelist max width/height of image if an image is specified, Fixes #3