Here is a script to detect if there is a landscape or portrait img on a region of a webpage