In some cases, picture's extension is not recognized so change the logic to determine if it exists or not
Catch Exception and log them in cron class