1. A method of analyzing an image, the method comprising: identifying a selected portion of an image as a focus portion to be categorized within one of a plurality of textual categories; generating a score for patches of the image by comparing each patch to a codeword from a codebook, the patches being subdivisions of the image; associating a category of the focus portion with the image as one of the plurality of textual categories based on the score; determining a layout of the image based on at least one of a size or position of the focus portion of the image; and storing the image in a computer readable storage medium, the image stored with metadata that includes the category and layout.