Fixed problem where images could be out of order