added possibility to maintain original file extension using rename upload filter
[#3990] CS fixes

- elseif clause