logic for image portfolio