fixing media collection filering, #566
add svg support to isImage
upload images to media dir if defined, closes #566