added a check so picture Ids only get processed if they actually need to be