added a check so picture Ids only get processed if they contain spaces