Reimplemented the image border functionality, and improved image quality by not especifiying dpi for automatically scaled images.