Return integer instead of string in get_attachment()