adding sql for picture objects