Código php:
Ver originalif (!((strpos($tipo_archivo, "gif") || strpos($tipo_archivo, "jpeg")) && ($tamano_archivo < 5000000))) {
Tu variable $tipo_archivo trae el tipo MIME del archivo, ej: "image/jpeg" o "image/gif". Por eso siempre te muestra ese error.