You are using imgdir.php to display your directory contents.

In order for imgdir to work properly, it must have write-access
to a .imgdir directory at the top level of this webpage.

You may either open up the access to the webpage completely and the
program will create the .imgdir directory for you:

% chmod 777 /var/www/html/mywebsite

or you can create the .imgdir directory yourself and
only open up only it's access:

% cd /var/www/html/mywebsite
% mkdir .imgdir
% chmod 777 .imgdir

The latter method is the most secure.