Fixed bug in PictureRegistry. Improved border cleaning.