Wordpress function to get luminance of an attachment by its attachment ID