Moving the pattern into a function in preparation for adding a restriction on upload directory.

See #13
Fixing sizes for L4, closes #25