How to add an image to a custom url?

Upload an image to the Media Library like usual.

Go into Settings > Media and untick the box that says:

Organise my uploads into month- and year-based folders

Then add the following line to your wp-config.php file:

define( 'UPLOADS', 'images/'.'files' );