PHP: List sort and organize images and pictures