Added sorting by pictures and mixed references to max and mins of certain data types.