Filtering out non-jpeg images for now. Code cleanup.