added check for image limit and group before upload