Fix for issue 1378 and Media.java

Fixed issue with crash on certain cards. Even tough the issue is fixed more validation code would probably be a good idea (new issue maybe?) 

Removed some unnecessary code from previous commit where I created a new variable for a directory instead of using an existing variable.