Added helper function to get latest image based on a filter.