Нужно чтобы при случайном выборе ставала картинка(одна из

. Не могу осуществить. А без репит прога не так работает.
Procedure desk;
begin
if random(8)=1 then drawImage(a,0,0);
if random(8)=2 then drawImage(a1,0,0);
if random(8)=3 then drawImage(a2,0,0);
if random(8)=4 then drawImage(a3,0,0);
if random(8)=5 then drawImage(a4,0,0);
if random(8)=6 then drawImage(a5,0,0);
if random(8)=7 then drawImage(a6,0,0);
if random(8)=8 then drawImage(a7,0,0);
repeat
drawImage(today,0,getheight-26);
drawImage(pan,0,0);
drawImage(start,0,0);
if (x>0) and (x<38) and (y>0) and (y<26) then drawImage(start2,0,0);
//////
setcolor(255,255,255);
time:=getCurrentTime;
times:=''+getHour(time);
times:=times+':'+ getMinute(time);
drawText(times,getwidth-38,5);
//////
mouseX;
repaint;
until bulOff=true;
end;