The problem is solved. The problem was that I had an echo in index.php.
I have tried to disable and enable file locking. I have tried to set full permission on the files in the upload folder (permission: 777).
I can see the images when I comment out these lines in htaccess:
#RewriteRule ^([^?]*)$ /index.php?uamfiletype=attachment&uamgetfile=$1 [QSA,L]
#RewriteRule ^(.*)\?(((?!uamfiletype).)*)$ /index.php?uamfiletype=attachment&uamgetfile=$1&$2 [QSA,L]
#RewriteRule ^(.*)\?(.*)$ /index.php?uamgetfile=$1&$2 [QSA,L]