clean up pictures.js a bit