Added code to validate profile images. Currently, editing profiles is broken. Todo: fix this.