bugfixes in adding pictures