Added some rights checking to the image management stuff. #326