Single function to get wordpress attachment id from an img src