LPS-35986 Applied the pattern from Journal

Hi Tamás,

You've already reviewed this and found an error with NPE when small file URL is used instead of uploaded file.

I fixed that in this PR as well.

Cheers,
Vilmos