Changing opacity using buffer

Hi,
I am using buffer for loading my images and then try to read from that buffer and change the opacity but there are a lot of drop frames. Can some one help me regarding this?

This is two mentioned parts of my code:

img_buffer1 =

for img_path in image_list1:

    tmp_img = psychopy.visual.ImageStim(win, image=img_path, size=(500, 500), units='pix', pos=exp_params["img1_coords"])
    
    img_buffer1.append(psychopy.visual.BufferImageStim(win, stim=[tmp_img]))

if calculated_frame < len(opacity_list1):

    img_buffer1[exemplar_list1[calculated_frame]].opacity = opacity_list1[calculated_frame]
    img_buffer1[exemplar_list1[calculated_frame]].draw()

    win.flip()
    
else:
   trial_done = True