Pic upload functionality working with local files and URLs