Bugfix addpicture

Fix based on patch:
https://issues.apache.org/bugzilla/show_bug.cgi?id=55476